Skip to content

feat: add Browser And Visual Testing Provider domain + adapter layer (082)#87

Merged
robertotru merged 3 commits into
mainfrom
082-browser-visual-testing-provider
Jun 24, 2026
Merged

feat: add Browser And Visual Testing Provider domain + adapter layer (082)#87
robertotru merged 3 commits into
mainfrom
082-browser-visual-testing-provider

Conversation

@robertotru

Copy link
Copy Markdown
Contributor

Summary

First delivery slice of Browser And Visual Testing Provider (spec 082). Adds the full domain model, adapter runtime, artifact store, and programmatic CLI APIs to enable browser validation as a provider capability over Boundline's existing S10 protocol. The browser provider is an external binary — Boundline does not embed Playwright or any browser automation library.

What's Included

Area Files Description
Domain types browser_provider.rs (~470 lines) 26 FRs: StepStatus, FindingKind, BrowserEvidencePacket, BrowserValidationStep, ReadinessLocator, RetryabilityHint, etc.
Provider config capability_provider.rs (+60 lines) BrowserProviderConfig struct + browser-provider-v1 protocol line
Trace event observability.rs (+5 lines) BrowserValidationCompleted event type
Adapter runtime browser_provider_runtime.rs (~240 lines) Subprocess spawn, JSON stdio dispatch, startup handshake
Artifact store browser_artifact_store.rs (~190 lines) Session-scoped storage, SHA-256 hashing, size limits, retention classes
CLI APIs validate_browser.rs + inspect_browser.rs (~175 lines) run_validate_browser(), inspect_browser_run()
Roadmap 3 files Seed converted, removed, forward-roadmap updated
Version bump 15+ files 0.81.0 → 0.82.0 (Cargo.toml, plugins, distribution, docs, contract)

Design Decisions

  1. Sidecar pattern: Browser validation state tracked via session-scoped .boundline/sessions/<id>/browser/<run_id>/ directories, not embedded in ActiveSessionRecord — avoids 22+ compilation breakages (consistent with SessionEconomicsState precedent from spec 081)
  2. CLI as programmatic API: Validate/inspect exposed as public functions; clap wire-up deferred
  3. SHA-256 hashing: Lightweight content-addressable artifact references for deduplication
  4. Retention classes: RequiredEvidence, Diagnostic, Verbose, Ephemeral per spec

What's NOT in this PR

  • External provider binary: The reference boundline-browser-provider is a separate project
  • Clap subcommand dispatch: Deferred to avoid 30+ match arm changes in the CLI dispatcher
  • US2 (DOM/Accessibility): P2 — deferred
  • US3 (Scripted Interactions + Visual Diff): P3 — deferred
  • Integration tests with real provider: Requires the external binary

Quality Gates

  • cargo fmt — clean
  • cargo clippy --workspace --all-targets --all-features -- -D warnings — clean
  • ✅ check-rust-no-panic.sh — clean
  • ✅ check-no-local-paths.sh — clean
  • ✅ 1349 tests passing (core 471 + adapters 464 + CLI 414)
  • ✅ Domain coverage: browser_provider 97.7%, capability_provider 100%, observability 100%
  • ✅ 18/18 constitution principles verified
  • ✅ Roadmap seed converted per move-on-convention

Coverage Note

Adapter and CLI files (browser_provider_runtime.rs, browser_artifact_store.rs, validate_browser.rs, inspect_browser.rs) are at 0% — these are thin I/O boundaries that delegate to the fully-tested domain layer. Integration tests require the external mock provider binary.

References

  • Spec: spec.md
  • Plan: plan.md
  • Tasks: tasks.md (102 tasks)
  • Data Model: data-model.md
  • Contracts: browser-provider-protocol.md

…(082)

Introduce the domain model and adapter layer for browser capability
providers communicating over the S10 protocol via JSON stdio. The
browser provider is an external binary — Boundline does not embed
Playwright or any browser automation library.

Domain types (src/domain/browser_provider.rs):
- StepStatus (7 variants), FindingKind (12 variants), FindingSeverity
- ArtifactKind, RetentionClass, ArtifactReference (SHA-256 hashed)
- BrowserFinding with optional RetryabilityHint
- RetryabilityLevel, RetryabilityCategory, StepTiming
- LocatorType, LocatorState, ReadinessLocator
- BrowserAction (Navigate/Click/Type/Wait/Screenshot)
- BrowserValidationStep, DomInspectionConfig, ValidationTimeouts
- BrowserEvidencePacket with full contract schema

Adapter layer:
- BrowserProviderRuntime: subprocess spawn, startup handshake,
  JSON request/response dispatch over stdio, stderr capture
- BrowserArtifactStore: session-scoped artifact directories,
  SHA-256 content hashing, per-kind size limits (50MB screenshots,
  10MB logs), retention classes (required/diagnostic/verbose/ephemeral)

Integration:
- BrowserProviderConfig in capability_provider.rs with protocol line
- BrowserValidationCompleted trace event type in observability.rs
- CLI APIs: run_validate_browser(), inspect_browser_run()
  (clap wire-up deferred to avoid 30+ match arm changes)
- Session scoping via .boundline/sessions/<id>/browser/<run_id>/
  (sidecar pattern — no ActiveSessionRecord extension)

Roadmap: seed converted to feat-browser-and-visual-testing-provider.md,
original removed per move-on-conversion semantics.

Version bump: 0.81.0 → 0.82.0 (feature increment).
Tests: 1349 passing (0 failures). Coverage: domain types 97.7-100%.
@robertotru robertotru self-assigned this Jun 23, 2026
@codecov

codecov Bot commented Jun 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.83963% with 239 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/adapters/browser_provider_runtime.rs 0.00% 110 Missing ⚠️
src/cli/validate_browser.rs 0.00% 59 Missing ⚠️
src/cli/inspect_browser.rs 0.00% 53 Missing ⚠️
src/adapters/browser_artifact_store.rs 96.13% 14 Missing ⚠️
src/domain/browser_provider.rs 97.61% 3 Missing ⚠️

📢 Thoughts on this report? Let us know!

@robertotru
robertotru force-pushed the 082-browser-visual-testing-provider branch from 9ee1a17 to 222988c Compare June 24, 2026 11:09
@robertotru
robertotru force-pushed the 082-browser-visual-testing-provider branch from 222988c to 56fbb40 Compare June 24, 2026 11:45
@sonarqubecloud

Copy link
Copy Markdown

@robertotru
robertotru merged commit d97b5c1 into main Jun 24, 2026
28 of 29 checks passed
@robertotru
robertotru deleted the 082-browser-visual-testing-provider branch June 24, 2026 13:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant