mirror of
https://github.com/kunchenguid/no-mistakes.git
synced 2026-09-19 07:53:54 +08:00
5dbbb3aaec
* test(agent): cover antigravity in fakeagent and the e2e user journey * no-mistakes(document): Add antigravity to agent lists, doctor example, and fakeagent doc comment * no-mistakes(document): Add antigravity to agent Values and auto resolution order in docs * feat(recordfixture): capture antigravity fixtures via the owned e2e-record workflow * no-mistakes(review): Assert Antigravity recorder argv forwarding; focused tests pass * fix(recordfixture): stage agy captures atomically and contain the process tree * no-mistakes(review): Test plain fixture replay path by splitting TestRunAgyReplaysRecordedFixture into structured/plain subtests * no-mistakes(review): Validate Antigravity captures and replay configured fixtures reliably * no-mistakes(document): Document Antigravity capture and replay behavior * no-mistakes: apply CI fixes * fix(recordfixture): expect cmd-exe quote escaping in agy argv test; dedupe antigravity docs The windows-core run at 0ba9bd95 failed TestCaptureAgyPlacesForwardedFlagsBeforePromptAndSchemaLast because the fake .cmd agent records Go's literal backslash-quote escaping: cmd.exe %~1 expansion does not undo it, while real agy parses argv with CommandLineToArgvW and sees the unescaped JSON. Assert the escaped schema arg on Windows with a comment explaining the harness-only artifact. After rebasing onto main (#812), agents.md carried two Antigravity adapter sections and two supported-agents table rows. Keep one of each, reflecting final capabilities: session resume via --conversation and terminal-authoritative result precedence (structured_output > result.response > stream deltas). * fix(recordfixture): reject any non-SUCCESS agy result during capture validation validateAgyCapture only inspected the final result status, so a capture containing an ERROR result followed by SUCCESS validated even though the production replay parser treats any ERROR result as fatal. Fail fast on the first non-SUCCESS result and require at least one result event.
123 lines
5.3 KiB
Makefile
123 lines
5.3 KiB
Makefile
VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo dev)
|
|
COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo unknown)
|
|
DATE ?= $(shell date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
DEFAULT_UMAMI_HOST := https://a.kunchenguid.com
|
|
DEFAULT_UMAMI_WEBSITE_ID := f959e889-92f5-4121-8a1f-571b10861198
|
|
DOTENV_UMAMI_HOST := $(shell [ -f .env ] && perl -ne 'next if /^\s*(?:\#|$$)/; s/^\s*export\s+//; next unless /^\s*NO_MISTAKES_UMAMI_HOST\s*=\s*(.*)$$/; $$v=$$1; $$v =~ s/^\s+|\s+$$//g; if ($$v =~ /^( ["\x27] )(.*)\1$$/x) { $$v=$$2; } else { $$v =~ s/\s+\#.*$$//; $$v =~ s/\s+$$//; } $$out=$$v; END { print $$out if defined $$out }' .env)
|
|
DOTENV_UMAMI_WEBSITE_ID := $(shell [ -f .env ] && perl -ne 'next if /^\s*(?:\#|$$)/; s/^\s*export\s+//; next unless /^\s*NO_MISTAKES_UMAMI_WEBSITE_ID\s*=\s*(.*)$$/; $$v=$$1; $$v =~ s/^\s+|\s+$$//g; if ($$v =~ /^(["\x27])(.*)\1$$/) { $$v=$$2; } else { $$v =~ s/\s+\#.*$$//; $$v =~ s/\s+$$//; } $$out=$$v; END { print $$out if defined $$out }' .env)
|
|
override UMAMI_HOST := $(if $(DOTENV_UMAMI_HOST),$(DOTENV_UMAMI_HOST),$(if $(UMAMI_HOST),$(UMAMI_HOST),$(DEFAULT_UMAMI_HOST)))
|
|
override UMAMI_WEBSITE_ID := $(if $(DOTENV_UMAMI_WEBSITE_ID),$(DOTENV_UMAMI_WEBSITE_ID),$(if $(UMAMI_WEBSITE_ID),$(UMAMI_WEBSITE_ID),$(DEFAULT_UMAMI_WEBSITE_ID)))
|
|
LDFLAGS := -X github.com/kunchenguid/no-mistakes/internal/buildinfo.Version=$(VERSION) \
|
|
-X github.com/kunchenguid/no-mistakes/internal/buildinfo.Commit=$(COMMIT) \
|
|
-X github.com/kunchenguid/no-mistakes/internal/buildinfo.Date=$(DATE) \
|
|
-X github.com/kunchenguid/no-mistakes/internal/buildinfo.TelemetryHost=$(UMAMI_HOST) \
|
|
-X github.com/kunchenguid/no-mistakes/internal/buildinfo.TelemetryWebsiteID=$(UMAMI_WEBSITE_ID)
|
|
|
|
.PHONY: build dist install test e2e e2e-record lint fmt clean docs docs-build docs-preview demo skill skill-check
|
|
|
|
DIST_DIR ?= dist
|
|
INSTALL_BIN := $(shell go env GOPATH)/bin/no-mistakes
|
|
|
|
build:
|
|
go build -ldflags "$(LDFLAGS)" -o bin/no-mistakes ./cmd/no-mistakes
|
|
|
|
dist:
|
|
rm -rf $(DIST_DIR)
|
|
mkdir -p $(DIST_DIR)
|
|
for target in darwin/amd64 darwin/arm64 linux/amd64 linux/arm64 windows/amd64 windows/arm64; do \
|
|
os=$${target%/*}; \
|
|
arch=$${target#*/}; \
|
|
bin=no-mistakes; \
|
|
out="$(DIST_DIR)/$$bin"; \
|
|
if [ "$$os" = "windows" ]; then \
|
|
bin="$$bin.exe"; \
|
|
out="$(DIST_DIR)/$$bin"; \
|
|
fi; \
|
|
CGO_ENABLED=0 GOOS="$$os" GOARCH="$$arch" go build -ldflags "$(LDFLAGS)" -o "$$out" ./cmd/no-mistakes; \
|
|
if [ "$$os" = "windows" ]; then \
|
|
( cd "$(DIST_DIR)" && zip -q "no-mistakes-$(VERSION)-$$os-$$arch.zip" "$$bin" ); \
|
|
else \
|
|
tar -C "$(DIST_DIR)" -czf "$(DIST_DIR)/no-mistakes-$(VERSION)-$$os-$$arch.tar.gz" "$$bin"; \
|
|
fi; \
|
|
rm -f "$$out"; \
|
|
done
|
|
|
|
install: build
|
|
mkdir -p $(dir $(INSTALL_BIN))
|
|
install -m 755 bin/no-mistakes $(INSTALL_BIN)
|
|
$(INSTALL_BIN) daemon stop
|
|
$(INSTALL_BIN) daemon start
|
|
|
|
test:
|
|
go test -race ./...
|
|
|
|
# End-to-end suite: drives the real no-mistakes binary against a fake
|
|
# agent through the full push -> pipeline -> push journey for each
|
|
# e2e-covered agent backend, plus the step-local e2e tests that live
|
|
# next to the pipeline-step code (e.g. coverage provider journeys).
|
|
# Excluded from `make test` because it is behind the `e2e` build tag and
|
|
# rebuilds binaries on each run.
|
|
#
|
|
# scripts/e2e.sh owns temporary-daemon inventory + EXIT/INT/TERM reaping so
|
|
# an interrupted or timed-out go test child cannot leave detached e2e
|
|
# daemons behind. Keepalive shells are out of scope. A SIGKILL of the
|
|
# wrapper shell itself does not run its trap; next-run pre-reap recovers.
|
|
e2e:
|
|
@bash scripts/e2e.sh
|
|
|
|
# Re-record fixtures from the real claude/codex/opencode/antigravity CLIs and overwrite
|
|
# internal/e2e/fixtures/. Spends real API quota — run only when the upstream
|
|
# wire format changes or when adding a new agent or flavour. Personal paths are
|
|
# scrubbed automatically; review the diff before committing.
|
|
e2e-record:
|
|
go run ./cmd/recordfixture claude --out internal/e2e/fixtures/claude
|
|
go run ./cmd/recordfixture codex --out internal/e2e/fixtures/codex
|
|
go run ./cmd/recordfixture opencode --out internal/e2e/fixtures/opencode
|
|
go run ./cmd/recordfixture antigravity --out internal/e2e/fixtures/antigravity
|
|
|
|
# Regenerate the committed agent skill (skills/no-mistakes/SKILL.md) from the
|
|
# internal/skill source of truth.
|
|
skill:
|
|
go run ./cmd/genskill
|
|
|
|
# Fail if the committed skill has drifted from the generator. Wired into lint
|
|
# so CI catches a forgotten `make skill`.
|
|
skill-check:
|
|
go run ./cmd/genskill --check
|
|
|
|
lint: skill-check
|
|
go vet ./...
|
|
|
|
fmt:
|
|
gofmt -w .
|
|
|
|
docs: docs-build
|
|
|
|
docs-build:
|
|
cd docs && npm ci && npm run build
|
|
|
|
docs-preview:
|
|
cd docs && npm run preview
|
|
|
|
demo: build
|
|
vhs demo.tape
|
|
ffmpeg -i demo_raw.gif -filter_complex "\
|
|
[0:v]split[orig][zoom_src];\
|
|
[zoom_src]crop=963:570:0:0,scale=1100:650:flags=lanczos[zoomed];\
|
|
[orig]scale=1100:650:flags=lanczos[base];\
|
|
[base][zoomed]overlay=0:0:enable='lt(t,4.04)',setpts=1.9*PTS,\
|
|
split[s0][s1];\
|
|
[s0]palettegen=max_colors=128[p];\
|
|
[s1][p]paletteuse=dither=sierra2_4a\
|
|
" -r 10 -y demo.gif
|
|
ffmpeg -i demo_raw.gif -filter_complex "\
|
|
[0:v]split[orig][zoom_src];\
|
|
[zoom_src]crop=963:570:0:0,scale=1100:650:flags=lanczos[zoomed];\
|
|
[orig]scale=1100:650:flags=lanczos[base];\
|
|
[base][zoomed]overlay=0:0:enable='lt(t,4.04)',setpts=1.9*PTS\
|
|
" -c:v libx264 -pix_fmt yuv420p -movflags +faststart -r 30 -y demo.mp4
|
|
rm -f demo_raw.gif
|
|
|
|
clean:
|
|
rm -rf bin/
|