Files
BountyBoard/Makefile
T
etalon d698f70c4f feat: mock atomizer and work-performer services with contract tests (phase 11)
- services/atomizer: standalone Go module implementing §5.1 — Anthropic
  OpenAI-compatible chat completions by default, native /v1/messages when
  LLM_API_STYLE=anthropic, strict-JSON prompting, defensive fence-stripping
  parse with one retry, deterministic equal-split fallback without an API
  key, exact coefficient-sum normalization, bearer auth
- services/work-performer: Node 20 http server implementing §5.2 — single
  concurrency, /work/{jobId}/TASK.md preparation, attachment downloads,
  optional shallow git clone, claude CLI execution with JSON output,
  simulated success when the CLI is unavailable (offline demo), artifact
  endpoint, idempotent HMAC-signed callbacks with retry, best-effort cancel
- compose profile 'mocks': separate builds/ports/tokens, healthchecks,
  ${HOME}/.claude(.json) mounted read-only into the performer
- contract tests (go test -tags=contract) for both services; Makefile
  test-contract target; verified live incl. a real Claude Code job run

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-06-12 20:31:39 +02:00

43 lines
1.1 KiB
Makefile

GO ?= go
.PHONY: build run test test-integration lint seed smoke backup restore
build:
$(GO) build ./...
cd services/atomizer && $(GO) build ./...
run:
$(GO) run ./cmd/app
test:
$(GO) test ./...
# Requires Mongo reachable on 127.0.0.1:27017 (or MONGO_TEST_URI):
# docker compose -f docker-compose.yml -f docker-compose.test.yml up -d mongo
test-integration:
$(GO) test -tags=integration ./...
# Requires the mock services running:
# docker compose --profile mocks up -d --build atomizer-mock work-performer
test-contract:
ATOMIZER_TOKEN=$$(grep '^ATOMIZER_TOKEN=' .env | cut -d= -f2-) \
WORK_PERFORMER_TOKEN=$$(grep '^WORK_PERFORMER_TOKEN=' .env | cut -d= -f2-) \
$(GO) test -tags=contract -count=1 -timeout=8m ./internal/contract/
lint:
@unformatted=$$(gofmt -l .); if [ -n "$$unformatted" ]; then \
echo "gofmt needed on:"; echo "$$unformatted"; exit 1; fi
$(GO) vet ./...
seed:
@echo "seed script lands in phase 12 (scripts/seed.go)"; exit 1
smoke:
./scripts/smoke.sh
backup:
@echo "backup target lands in phase 12"; exit 1
restore:
@echo "restore target lands in phase 12"; exit 1