Generate contract types, pin fixtures to spec, add build and ADRs
Some checks failed
ci / build (push) Failing after 1m6s
Some checks failed
ci / build (push) Failing after 1m6s
Completes FLUID-WP-0002. The record types in internal/contract are generated from schemas/ by a dependency-free generator; fixtures transcribed from the spec's worked examples validate against those schemas and round-trip through the generated types with DisallowUnknownFields, so a spec change that misses the schemas fails CI rather than drifting silently. Adds identifier prefix helpers, Makefile, GitHub Actions, and five ADRs recording the Go choice, out-of-process attachment, the wire contract as boundary, the evidence store, and revision identity. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014KmVxhJ35tCo7rE7UnLwWu Assistant: claude-code Assistant-Model: opus Assistant-Process: 1116572@bnt-lap001 Assistant-Session: 8ba9bb93-a72a-4883-b189-2499cce5c400
This commit is contained in:
parent
fbbf56df7a
commit
76912adef8
44 changed files with 4010 additions and 7 deletions
54
Makefile
Normal file
54
Makefile
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
# FLUID core — build, generation and conformance.
|
||||
#
|
||||
# The record types in internal/contract are generated from schemas/. Never edit
|
||||
# them by hand: run `make generate`.
|
||||
|
||||
GO ?= go
|
||||
PYTHON ?= python3
|
||||
PKGS := ./...
|
||||
|
||||
.PHONY: all
|
||||
all: generate build vet test validate
|
||||
|
||||
.PHONY: generate
|
||||
generate: ## Regenerate Go types from schemas/
|
||||
$(GO) run ./tools/schemagen
|
||||
gofmt -w internal/contract
|
||||
|
||||
.PHONY: build
|
||||
build:
|
||||
$(GO) build $(PKGS)
|
||||
|
||||
.PHONY: vet
|
||||
vet:
|
||||
$(GO) vet $(PKGS)
|
||||
|
||||
.PHONY: test
|
||||
test: validate
|
||||
$(GO) test $(PKGS)
|
||||
|
||||
.PHONY: validate
|
||||
validate: ## Validate spec-derived fixtures against the schemas
|
||||
$(PYTHON) conformance/validate_schemas.py
|
||||
|
||||
.PHONY: check-generated
|
||||
check-generated: ## Fail if generated code is stale relative to schemas/
|
||||
@$(MAKE) --no-print-directory generate
|
||||
@if ! git diff --quiet -- internal/contract; then \
|
||||
echo "internal/contract is stale — run 'make generate' and commit the result"; \
|
||||
git --no-pager diff --stat -- internal/contract; \
|
||||
exit 1; \
|
||||
fi
|
||||
|
||||
.PHONY: conformance
|
||||
conformance: ## Full conformance suite (grows through FLUID-WP-0007)
|
||||
$(GO) test ./conformance/... $(PKGS)
|
||||
|
||||
.PHONY: clean
|
||||
clean:
|
||||
rm -rf bin internal/contract/*.broken
|
||||
|
||||
.PHONY: help
|
||||
help:
|
||||
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | \
|
||||
awk 'BEGIN {FS = ":.*?## "}; {printf " \033[36m%-18s\033[0m %s\n", $$1, $$2}'
|
||||
Loading…
Add table
Add a link
Reference in a new issue