Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: CI

on:
push:
branches: [ "main" ]
paths-ignore:
- 'README.md'
- '*.md'
- 'website/**'
- 'docs/**'
pull_request:
paths-ignore:
- 'README.md'
- '*.md'
- 'website/**'
- 'docs/**'

jobs:

test:

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true

- name: Build
run: go build ./...

- name: Vet
run: go vet ./...

- name: Test
run: go test -race ./...

- name: Check go.mod and go.sum are tidy
run: |
go mod tidy
git diff --exit-code go.mod go.sum
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ require (
github.com/tidwall/gjson v1.8.1
github.com/weppos/publicsuffix-go v0.50.0
golang.org/x/net v0.44.0
maragu.dev/gomponents v1.1.0
)

require (
github.com/andybalholm/cascadia v1.1.0 // indirect
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab // indirect
github.com/hashicorp/go-cleanhttp v0.5.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/inconshreveable/mousetrap v1.0.0 // indirect
Expand All @@ -39,5 +39,4 @@ require (
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect
gopkg.in/ini.v1 v1.62.0 // indirect
gopkg.in/yaml.v2 v2.4.0 // indirect
maragu.dev/gomponents v1.1.0 // indirect
)
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM=
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab h1:VYNivV7P8IRHUam2swVUNkhIdp0LRRFKe4hXNnoZKTc=
github.com/gomarkdown/markdown v0.0.0-20260217112301-37c66b85d6ab/go.mod h1:JDGcbDT52eL4fju3sZ4TeHGsQwhG9nbDV21aMyhwPoA=
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
Expand Down
12 changes: 11 additions & 1 deletion pkg/ai/normalizer_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,17 @@ func TestNormalizerScenarios(t *testing.T) {
t.Run("sanitize deduplicates", func(t *testing.T) {
in := []string{"Example.COM ", " example.com", " "}
out := sanitizeTargets(in)
if len(out) != 1 || out[0] != "example.com" {
if !reflect.DeepEqual(out, []string{"Example.COM"}) {
t.Fatalf("sanitize failed: %v", out)
}
})

// Casing is the model's call: it lowercases domains but keeps descriptive
// text verbatim, so sanitizeTargets must not lowercase on its own.
t.Run("sanitize preserves casing", func(t *testing.T) {
in := []string{"Any other asset is Out of Scope"}
out := sanitizeTargets(in)
if !reflect.DeepEqual(out, in) {
t.Fatalf("sanitize failed: %v", out)
}
})
Expand Down
Loading