Skip to content

Commit d5d4310

Browse files
committed
chore: remove dead packages and make the CI fuzz gate real
- Delete internal/jsonc and internal/providers: zero production importers. - Drop their references from the Makefile test-new/cover-new targets. - Add a non-mutating fmt-check target and use it in make ci. - Fix the fuzz job: each target now names a single package (./cmd/... had multiple, so the cmd target failed setup silently) and failures are no longer swallowed by || true.
1 parent c672571 commit d5d4310

10 files changed

Lines changed: 18 additions & 1865 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -531,12 +531,15 @@ jobs:
531531
cache: true
532532
- name: Run fuzz targets
533533
run: |
534-
go test -fuzz=FuzzScanForAIComments -fuzztime=60s ./cmd/... || true
535-
go test -fuzz=FuzzValidateSettings -fuzztime=60s ./internal/config/... || true
536-
go test -fuzz=FuzzIsSuspicious -fuzztime=60s ./internal/tool/... || true
537-
go test -fuzz=FuzzIsSafeGitCommit -fuzztime=60s ./internal/tool/... || true
538-
go test -fuzz=FuzzParseMessage -fuzztime=60s ./internal/session/... || true
539-
go test -fuzz=FuzzParseSessionMeta -fuzztime=60s ./internal/session/... || true
534+
# Each target must name a single package: `-fuzz` rejects `./x/...`
535+
# when it expands to more than one package, which previously made the
536+
# cmd target fail setup silently under `|| true`.
537+
go test -run='^$' -fuzz=FuzzScanForAIComments -fuzztime=60s ./cmd
538+
go test -run='^$' -fuzz=FuzzValidateSettings -fuzztime=60s ./internal/config
539+
go test -run='^$' -fuzz=FuzzIsSuspicious -fuzztime=60s ./internal/tool
540+
go test -run='^$' -fuzz=FuzzIsSafeGitCommit -fuzztime=60s ./internal/tool
541+
go test -run='^$' -fuzz=FuzzParseMessage -fuzztime=60s ./internal/session
542+
go test -run='^$' -fuzz=FuzzParseSessionMeta -fuzztime=60s ./internal/session
540543
541544
# -------------------------------------------------------------------------
542545
# 10. Smoke — build rho and verify ecosystem CLI wiring.

‎Makefile‎

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ test-10x: ## Run tests 10 times to surface flakes.
7373
go test ./... -race -count=10 -timeout=600s
7474

7575
test-new: ## Run only the Round 2 ecosystem packages (fast iteration).
76-
go test -race -count=1 -timeout=60s ./internal/safewrite/... ./internal/jsonc/... ./internal/providers/... ./internal/session/... ./internal/permissions/...
76+
go test -race -count=1 -timeout=60s ./internal/safewrite/... ./internal/session/... ./internal/permissions/...
7777

7878
test-live: ## Run opt-in live integration tests (requires real LLM credentials).
7979
@echo "Running live integration tests — requires OPENCODEGO_API_KEY"
@@ -86,7 +86,7 @@ cover: ## Generate a coverage report (coverage.out + coverage.html).
8686
@echo "Coverage report: coverage.html"
8787

8888
cover-new: ## Coverage report for Round 2 ecosystem packages only.
89-
go test -cover -timeout=30s ./internal/safewrite/... ./internal/jsonc/... ./internal/providers/... ./internal/session/... ./internal/permissions/...
89+
go test -cover -timeout=30s ./internal/safewrite/... ./internal/session/... ./internal/permissions/...
9090

9191
api-docs: ## Generate HTML API reference from OpenAPI spec.
9292
@command -v redoc-cli >/dev/null 2>&1 || (echo "install: npm install -g redoc-cli" && exit 1)
@@ -109,6 +109,12 @@ fmt: ## Format source files (gofumpt + goimports).
109109
@git ls-files -- '*.go' | xargs $(GOFUMPT) -w
110110
@git ls-files -- '*.go' | xargs $(GOIMPORTS) -w
111111

112+
fmt-check: ## Verify formatting without rewriting files (CI-safe).
113+
@command -v $(GOFUMPT) >/dev/null 2>&1 || (echo "install: go install mvdan.cc/gofumpt@latest" && exit 1)
114+
@command -v $(GOIMPORTS) >/dev/null 2>&1 || (echo "install: go install golang.org/x/tools/cmd/goimports@latest" && exit 1)
115+
@out=$$(git ls-files -- '*.go' | xargs $(GOFUMPT) -l); if [ -n "$$out" ]; then echo "gofumpt found unformatted files:"; echo "$$out"; exit 1; fi
116+
@out=$$(git ls-files -- '*.go' | xargs $(GOIMPORTS) -l); if [ -n "$$out" ]; then echo "goimports found unformatted files:"; echo "$$out"; exit 1; fi
117+
112118
vet: ## Run go vet.
113119
go vet ./...
114120

@@ -154,7 +160,7 @@ tidy: ## Sync workspace modules and verify checksums.
154160
# ---------------------------------------------------------------------------
155161
# Composite gate used by CI and pre-push.
156162
# ---------------------------------------------------------------------------
157-
ci: tidy fmt vet boundaries lint test-race security api-validate ## Run everything CI runs.
163+
ci: tidy fmt-check vet boundaries lint test-race security api-validate ## Run everything CI runs.
158164
@echo "All CI checks passed."
159165

160166
smoke: ## Quick build + doctor + ecosystem verification.

‎internal/jsonc/jsonc.go‎

Lines changed: 0 additions & 153 deletions
This file was deleted.

‎internal/jsonc/jsonc_extra_test.go‎

Lines changed: 0 additions & 37 deletions
This file was deleted.

0 commit comments

Comments
 (0)