# hhv01/automation_becaros architecture

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

- Interactive diagram: https://gitdiagram.com/hhv01/automation_becaros
- Repository: https://github.com/hhv01/automation_becaros

## Overview

This repository is a shared Playwright QC automation framework with an AI-agent runtime and reusable UI/API/WebSocket test support. Its main agent workflow takes a user request and feature scope, selects a testcase, exploratory, or regression workflow, lets the QC agent inspect project context and run tests through guarded tools, then validates and emits a report. The tree and sampled source support the agent and helper-layer connections shown; the broader documented BA-to-automation pipeline is not represented in the supplied tree, so its stages are omitted.

Main entry points: [`automation-agent-kit/agents/qc.agent.ts`](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/agents/qc.agent.ts) (QC agent), [`automation-agent-kit/run-agent.ts`](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/run-agent.ts) (Agent entrypoint), [`automation-agent-kit/workflows/index.ts`](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/index.ts) (Workflow selector), [`automation-agent-kit/tools/playwright.tool.ts`](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/tools/playwright.tool.ts) (Playwright runner tool)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_agent["Agent runtime"]
  node_entry["Agent entrypoint<br/>[run-agent.ts]"]
  node_workflow["Workflow selector<br/>[index.ts]"]
  node_regression["Regression workflow"]
  node_testcase["Testcase workflow"]
  node_exploratory["Exploratory workflow"]
  node_qc["QC agent<br/>[qc.agent.ts]"]
  node_context["Harness context<br/>[context.ts]"]
  node_execution_guard["Execution guardrails"]
  node_result_guard["Result guardrails"]
  node_schemas["Result schemas"]
end

subgraph group_execution["Test execution"]
  node_testcase_tools["Project context tools<br/>[testcase.tool.ts]"]
  node_pw_tool["Playwright runner tool<br/>[playwright.tool.ts]"]
  node_test_runner["Project test runner<br/>[project-test.mjs]"]
  node_report_tool["Playwright report tool<br/>[report.tool.ts]"]
end

subgraph group_support["Test support"]
  node_api["API request client<br/>[base.api.ts]"]
  node_api_recorder["API call recorder"]
  node_ws["WebSocket helpers<br/>[ws-helper.ts]"]
  node_mission_page["Mission form page"]
  node_scheduler_page["Scheduler page<br/>[scheduler.page.ts]"]
end

subgraph group_reporting["Results and reporting"]
  node_final_report["QC report renderer<br/>[final-report.ts]"]
  node_report_files["QC reports"]
end

node_user(("QC requester"))
node_target_app["Test application"]
node_ws_service["WebSocket API"]

node_user -->|"submits request"| node_entry
node_entry -->|"builds workflow input"| node_workflow
node_workflow -->|"selects regression"| node_regression
node_workflow -->|"selects testcase"| node_testcase
node_workflow -->|"selects exploratory"| node_exploratory
node_entry -->|"runs agent"| node_qc
node_qc -->|"checks input"| node_execution_guard
node_qc -->|"checks output"| node_result_guard
node_result_guard -->|"validates result"| node_schemas
node_qc -->|"dispatches context tools"| node_testcase_tools
node_qc -->|"dispatches test tool"| node_pw_tool
node_qc -->|"dispatches report tool"| node_report_tool
node_pw_tool -->|"guards execution"| node_execution_guard
node_pw_tool -->|"spawns runner"| node_test_runner
node_test_runner -->|"runs tests against"| node_target_app
node_report_tool -->|"reads run report"| node_report_files
node_entry -->|"parses result"| node_schemas
node_entry -->|"renders report"| node_final_report
node_final_report -->|"writes HTML"| node_report_files
node_api -->|"records calls"| node_api_recorder
node_ws -->|"subscribes to topics"| node_ws_service
node_mission_page -->|"drives mission UI"| node_target_app
node_scheduler_page -->|"drives scheduler UI"| node_target_app

click node_entry "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/run-agent.ts"
click node_workflow "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/index.ts"
click node_regression "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/regression.workflow.ts"
click node_testcase "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/testcase.workflow.ts"
click node_exploratory "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/exploratory.workflow.ts"
click node_qc "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/agents/qc.agent.ts"
click node_context "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/agents/context.ts"
click node_execution_guard "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/guardrails/execution.guardrail.ts"
click node_result_guard "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/guardrails/result.guardrail.ts"
click node_schemas "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/schemas/test-result.schema.ts"
click node_testcase_tools "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/tools/testcase.tool.ts"
click node_pw_tool "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/tools/playwright.tool.ts"
click node_test_runner "https://github.com/hhv01/automation_becaros/blob/master/scripts/project-test.mjs"
click node_report_tool "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/tools/report.tool.ts"
click node_final_report "https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/reporting/final-report.ts"
click node_api "https://github.com/hhv01/automation_becaros/blob/master/api/base.api.ts"
click node_api_recorder "https://github.com/hhv01/automation_becaros/blob/master/utils/api-report-recorder.ts"
click node_ws "https://github.com/hhv01/automation_becaros/blob/master/utils/ws-helper.ts"
click node_mission_page "https://github.com/hhv01/automation_becaros/blob/master/pages/mission-form.page.ts"
click node_scheduler_page "https://github.com/hhv01/automation_becaros/blob/master/pages/scheduler.page.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_entry,node_workflow,node_regression,node_testcase,node_exploratory,node_qc,node_context,node_execution_guard,node_result_guard,node_schemas toneBlue
class node_testcase_tools,node_pw_tool,node_test_runner,node_report_tool toneAmber
class node_api,node_api_recorder,node_ws,node_mission_page,node_scheduler_page,node_user,node_ws_service toneMint
class node_final_report,node_report_files toneRose
class node_target_app toneIndigo
```

## Components

### Agent runtime

- [Agent entrypoint](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/run-agent.ts): `automation-agent-kit/run-agent.ts`
- [Workflow selector](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/index.ts): `automation-agent-kit/workflows/index.ts`
- [Regression workflow](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/regression.workflow.ts): `automation-agent-kit/workflows/regression.workflow.ts`
- [Testcase workflow](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/testcase.workflow.ts): `automation-agent-kit/workflows/testcase.workflow.ts`
- [Exploratory workflow](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/workflows/exploratory.workflow.ts): `automation-agent-kit/workflows/exploratory.workflow.ts`
- [QC agent](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/agents/qc.agent.ts): `automation-agent-kit/agents/qc.agent.ts`
- [Harness context](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/agents/context.ts): `automation-agent-kit/agents/context.ts`
- [Execution guardrails](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/guardrails/execution.guardrail.ts): `automation-agent-kit/guardrails/execution.guardrail.ts`
- [Result guardrails](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/guardrails/result.guardrail.ts): `automation-agent-kit/guardrails/result.guardrail.ts`
- [Result schemas](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/schemas/test-result.schema.ts): `automation-agent-kit/schemas/test-result.schema.ts`

### Test execution

- [Project context tools](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/tools/testcase.tool.ts): `automation-agent-kit/tools/testcase.tool.ts`
- [Playwright runner tool](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/tools/playwright.tool.ts): `automation-agent-kit/tools/playwright.tool.ts`
- [Project test runner](https://github.com/hhv01/automation_becaros/blob/master/scripts/project-test.mjs): `scripts/project-test.mjs`
- [Playwright report tool](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/tools/report.tool.ts): `automation-agent-kit/tools/report.tool.ts`

### Test support

- [API request client](https://github.com/hhv01/automation_becaros/blob/master/api/base.api.ts): `api/base.api.ts`
- [API call recorder](https://github.com/hhv01/automation_becaros/blob/master/utils/api-report-recorder.ts): `utils/api-report-recorder.ts`
- [WebSocket helpers](https://github.com/hhv01/automation_becaros/blob/master/utils/ws-helper.ts): `utils/ws-helper.ts`
- [Mission form page](https://github.com/hhv01/automation_becaros/blob/master/pages/mission-form.page.ts): `pages/mission-form.page.ts`
- [Scheduler page](https://github.com/hhv01/automation_becaros/blob/master/pages/scheduler.page.ts): `pages/scheduler.page.ts`

### Results and reporting

- [QC report renderer](https://github.com/hhv01/automation_becaros/blob/master/automation-agent-kit/reporting/final-report.ts): `automation-agent-kit/reporting/final-report.ts`
- **QC reports**

### Other components

- **QC requester**
- **Test application**
- **WebSocket API**

## Connections

- QC requester → Agent entrypoint: submits request
- Agent entrypoint → Workflow selector: builds workflow input
- Workflow selector → Regression workflow: selects regression
- Workflow selector → Testcase workflow: selects testcase
- Workflow selector → Exploratory workflow: selects exploratory
- Agent entrypoint → QC agent: runs agent
- QC agent → Execution guardrails: checks input
- QC agent → Result guardrails: checks output
- Result guardrails → Result schemas: validates result
- QC agent → Project context tools: dispatches context tools
- QC agent → Playwright runner tool: dispatches test tool
- QC agent → Playwright report tool: dispatches report tool
- Playwright runner tool → Execution guardrails: guards execution
- Playwright runner tool → Project test runner: spawns runner
- Project test runner → Test application: runs tests against
- Playwright report tool → QC reports: reads run report
- Agent entrypoint → Result schemas: parses result
- Agent entrypoint → QC report renderer: renders report
- QC report renderer → QC reports: writes HTML
- API request client → API call recorder: records calls
- WebSocket helpers → WebSocket API: subscribes to topics
- Mission form page → Test application: drives mission UI
- Scheduler page → Test application: drives scheduler UI
