Skip to content

High-performance browser automation bridge and multi-instance orchestrator with advanced stealth injection and real-time dashboard.

fix(doctor): count only browser-launching checks (PIN-303)

Luigi Agostic57227abb83a
diff --git a/internal/browsers/cloak/doctor.go b/internal/browsers/cloak/doctor.go
index 356a3eef..41278a29 100644
--- a/internal/browsers/cloak/doctor.go
+++ b/internal/browsers/cloak/doctor.go
@@ -23,10 +23,9 @@ var launchAndProbe = chrome.LaunchAndProbe
func (Browser) DoctorChecks(_ browsers.TargetConfig) []browsers.DoctorCheck {
return []browsers.DoctorCheck{
{
- ID: "cloakbrowser_present",
- Description: "CloakBrowser binary found and version adequate",
- Fn: cloakPresenceCheck,
- LaunchesBrowser: true,
+ ID: "cloakbrowser_present",
+ Description: "CloakBrowser binary found and version adequate",
+ Fn: cloakPresenceCheck,
},
{
ID: "cdp_reachable",
diff --git a/internal/doctor/runner_test.go b/internal/doctor/runner_test.go
index 82720347..de83de4b 100644
--- a/internal/doctor/runner_test.go
+++ b/internal/doctor/runner_test.go
@@ -30,6 +30,21 @@ func TestSummarize_Counts(t *testing.T) {
}
}
+func TestSummarizeDoesNotCountPresenceAsABrowserLaunch(t *testing.T) {
+ results := []CheckResult{
+ {Name: "cloakbrowser_present", Status: StatusPass},
+ {Name: "cdp_reachable", Status: StatusSkip, LaunchesBrowser: true},
+ {Name: "fingerprint_flags_accepted", Status: StatusSkip, LaunchesBrowser: true},
+ }
+ got := Summarize(results)
+ if got.BrowserLaunched != 0 {
+ t.Fatalf("BrowserLaunched = %d, want 0 when only the presence check ran", got.BrowserLaunched)
+ }
+ if strings.HasPrefix(Verdict(got), "Clean:") {
+ t.Fatalf("Verdict() = %q, must not call a presence-only run clean", Verdict(got))
+ }
+}
+
func TestExitCode(t *testing.T) {
cases := []struct {
name string