Skip to content

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

style: apply gofmt formatting to all files

Yash Jadhav07afd4a76704
diff --git a/internal/handlers/find.go b/internal/handlers/find.go
index c40a2681..af5aa44b 100644
--- a/internal/handlers/find.go
+++ b/internal/handlers/find.go
@@ -19,14 +19,14 @@ type findRequest struct {
}
type findResponse struct {
- BestRef string `json:"best_ref"`
- Confidence string `json:"confidence"`
- Score float64 `json:"score"`
+ BestRef string `json:"best_ref"`
+ Confidence string `json:"confidence"`
+ Score float64 `json:"score"`
Matches []semantic.ElementMatch `json:"matches"`
- Strategy string `json:"strategy"`
- Threshold float64 `json:"threshold"`
- LatencyMs int64 `json:"latency_ms"`
- ElementCount int `json:"element_count"`
+ Strategy string `json:"strategy"`
+ Threshold float64 `json:"threshold"`
+ LatencyMs int64 `json:"latency_ms"`
+ ElementCount int `json:"element_count"`
}
// HandleFind performs semantic element matching against the accessibility
diff --git a/internal/semantic/benchmark_study_test.go b/internal/semantic/benchmark_study_test.go
index 4863a87b..9a455788 100644
--- a/internal/semantic/benchmark_study_test.go
+++ b/internal/semantic/benchmark_study_test.go
@@ -264,15 +264,15 @@ func studyCases() []studyCase {
// studyHardCases returns 10 intentionally-challenging query/element pairs
// designed to reveal differentiation between matchers:
//
-// Group A (query uses an abbreviation, 0 lexical word overlap):
-// expects embedding to win via character n-gram similarity.
+// Group A (query uses an abbreviation, 0 lexical word overlap):
+// expects embedding to win via character n-gram similarity.
//
-// Group B (query uses a paraphrase / synonym):
-// expects both matchers to struggle, revealing the ceiling of
-// surface-form-only matching.
+// Group B (query uses a paraphrase / synonym):
+// expects both matchers to struggle, revealing the ceiling of
+// surface-form-only matching.
//
-// Group C (ambiguous — multiple equally-plausible elements):
-// expects combined to win via score averaging.
+// Group C (ambiguous — multiple equally-plausible elements):
+// expects combined to win via score averaging.
func studyHardCases() []studyCase {
// Reuse page element sets from studyCases.
cases := studyCases()
diff --git a/internal/semantic/hashing_embedder.go b/internal/semantic/hashing_embedder.go
index 8ccc417f..1a813ca5 100644
--- a/internal/semantic/hashing_embedder.go
+++ b/internal/semantic/hashing_embedder.go
@@ -18,9 +18,9 @@ import (
// - L2-normalized output for cosine similarity compatibility
// - Zero external dependencies — pure Go
type HashingEmbedder struct {
- dim int // vector dimensionality
- ngramMin int // minimum character n-gram length
- ngramMax int // maximum character n-gram length
+ dim int // vector dimensionality
+ ngramMin int // minimum character n-gram length
+ ngramMax int // maximum character n-gram length
wordWeight float32 // weight factor for word-level features
ngramWeight float32 // weight factor for n-gram features
}
diff --git a/internal/semantic/semantic_test.go b/internal/semantic/semantic_test.go
index c765e4ab..fcb87ba0 100644
--- a/internal/semantic/semantic_test.go
+++ b/internal/semantic/semantic_test.go
@@ -471,8 +471,8 @@ func TestHashingEmbedder_SimilarTexts(t *testing.T) {
t.Fatalf("Embed error: %v", err)
}
- simSameWord := CosineSimilarity(vecs[0], vecs[1]) // share "submit"
- simUnrelated := CosineSimilarity(vecs[0], vecs[2]) // no shared words
+ simSameWord := CosineSimilarity(vecs[0], vecs[1]) // share "submit"
+ simUnrelated := CosineSimilarity(vecs[0], vecs[2]) // no shared words
if simSameWord <= simUnrelated {
t.Errorf("texts sharing 'submit' should be more similar: same=%f, unrelated=%f",
@@ -485,9 +485,9 @@ func TestHashingEmbedder_SubwordSimilarity(t *testing.T) {
// Character n-grams should give nonzero similarity between "button" and "btn".
vecs, err := e.Embed([]string{
- "button", // full word
- "btn", // abbreviation – shares "bt" bigram via n-grams
- "search", // unrelated
+ "button", // full word
+ "btn", // abbreviation – shares "bt" bigram via n-grams
+ "search", // unrelated
})
if err != nil {
t.Fatalf("Embed error: %v", err)