mirror of
https://github.com/boshu2/agentops.git
synced 2026-09-14 15:08:13 +08:00
64e93c0428
Completes the Go CLI migration: one composition model, no tombstones, no dead packages, hermetic tests, and a cross-language verdict contract corpus. Net −88k lines. ## What - **Tombstones + prune deleted**: the 21 registered 'Removed in the Cathedral Cut' stubs, `zzz_default_spine.go`'s runtime prune, and the ~30 registered-but-pruned legacy command families are gone. The registered tree IS the production tree; retired verbs fail with exit 1 + a data-driven replacement hint pointing at docs/MIGRATION.md (now covering nested verbs). Non-runnable parents reject unknown subcommands instead of printing help with exit 0. - **~35 unreachable packages deleted** (cliapp, canon, pawl-era verdict parser, pool, harvest, knowledge, wiki engine, vibecheck, cli/embedded, …) after import analysis + script/CI consumer verification. Retained with named consumers: archcheck (arch gate scripts), eval island (rubric schema drift guards), drwitness/drrebuild (witness-crosscheck). - **Composition decision recorded**: single cmd/ao root + internal/commands/<family> modules + clicontract; the never-adopted cliapp.BuildRoot is removed. New overview: docs/architecture/go-cli.md (repairs two broken links). - **Hermetic tests**: flag_matrix_test.go builds the exec'd binary from package source — the stale cli/bin/ao failure class is closed; TestHermeticBinaryMatchesSourceSurface pins source↔binary correspondence. - **Verdict contract consolidated**: verification extracted from status.go into cli/internal/verdictcheck; 19-case golden corpus (tests/fixtures/verdict-contract) runs through Go + Python + JSON schema via blocking gate `contract.verdict-corpus`. One divergence closed (empty-string context ids now rejected by all three). - **Fossil guard chains retired**: embedded-sync (mirror had zero importers), retired-family compat baselines, dead go_cli_compatibility.bats, stale gate globs/grandfather entries. ## Evidence - Full-tier deterministic gate: **66/66 PASS** on the rebased tip (fresh source-built binary) - cli suite 2,795 tests green; race suite green on touched packages; vet + pinned golangci-lint clean - Cathedral Cut conformance PASS; CLI reference/surface projections regenerated and checked - Independent cross-family validation (fresh Codex context, frozen SHA): 5/6 claims CONFIRMED; 6th NOT_PROVEN only due to sandbox networking (its cached rerun of the same suite passed) - Test-count decrease is deliberate and carried by a Test-Removal-Reason trailer
65 lines
1.4 KiB
Makefile
65 lines
1.4 KiB
Makefile
.PHONY: build test lint clean install inner
|
|
|
|
# Build variables
|
|
BINARY_NAME=ao
|
|
BUILD_DIR=bin
|
|
VERSION=$(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
|
|
LDFLAGS=-ldflags "-X main.version=$(VERSION)"
|
|
IDENTIFIER=com.12factoragentops.ao
|
|
GOLANGCI_LINT ?= ../scripts/golangci-lint-v2.sh
|
|
|
|
# Default target
|
|
all: build
|
|
|
|
# Build the binary.
|
|
build:
|
|
@mkdir -p $(BUILD_DIR)
|
|
go build $(LDFLAGS) -o $(BUILD_DIR)/$(BINARY_NAME) ./cmd/ao
|
|
ifeq ($(shell uname -s),Darwin)
|
|
codesign -f -s - -i $(IDENTIFIER) $(BUILD_DIR)/$(BINARY_NAME)
|
|
endif
|
|
|
|
# Run tests
|
|
test: build
|
|
go test -v -shuffle=on ./...
|
|
|
|
# Run tests with coverage
|
|
test-coverage: build
|
|
go test -v -shuffle=on -coverprofile=coverage.out ./...
|
|
go tool cover -html=coverage.out -o coverage.html
|
|
|
|
# Run linter
|
|
lint:
|
|
$(GOLANGCI_LINT) run ./...
|
|
|
|
# Clean build artifacts
|
|
clean:
|
|
rm -rf $(BUILD_DIR)
|
|
rm -f coverage.out coverage.html
|
|
|
|
# Install to GOPATH/bin (builds first to ensure embedded files are synced)
|
|
install: build
|
|
@GOBIN=$$(go env GOBIN); [ -z "$$GOBIN" ] && GOBIN=$$(go env GOPATH)/bin; \
|
|
/bin/cp $(BUILD_DIR)/$(BINARY_NAME) "$$GOBIN/$(BINARY_NAME)"
|
|
|
|
# Run the binary
|
|
run: build
|
|
./$(BUILD_DIR)/$(BINARY_NAME)
|
|
|
|
# Tidy go modules
|
|
tidy:
|
|
go mod tidy
|
|
|
|
# Inner loop: <10s compile + vet (cached)
|
|
inner:
|
|
go build ./...
|
|
go vet ./...
|
|
|
|
# Format code
|
|
fmt:
|
|
go fmt ./...
|
|
|
|
# Generate (for future code generation)
|
|
generate:
|
|
go generate ./...
|