G0: cell substrate — invariants made executable
Strand G0 complete and VERIFIED against real Postgres, not asserted.
- FastAPI plane, fail-closed provider seams, repair-pointer error taxonomy
- migration 001: all 10 tables incl. repo_type NOT NULL and model_cards (I-7)
- 17 invariant tests, ruff clean, vocabulary audit clean
Two bugs found by RUNNING it that review would not have caught:
1. SQLAlchemy Enum persists .name, not .value — so RepoState.deleted_soft
and CreatedVia.imported would have written labels migration 001 never
declared, failing at runtime rather than at review. Pinned via
values_callable.
2. op.create_table asks each Enum to emit its own CREATE TYPE with no
checkfirst, so the second reference raised DuplicateObject and the
migration died halfway. Types are now created once, referenced with
create_type=False.
Proven live, with the hostile env var set:
- I-12: COMMIT_SHA=deadbeef... in the environment, /version reports real HEAD.
That env pin is the documented root cause of nine sibling services
misreporting their commit; here it is structurally ignored.
- I-8: three unconfigured providers -> status degraded, HTTP 503, each saying
'refusing to report healthy'. No mock, no false green.
- G0.4: upgrade -> downgrade -> upgrade round-trip clean (10 -> 0 -> 10).
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
41
Makefile
Normal file
41
Makefile
Normal file
@@ -0,0 +1,41 @@
|
||||
# The local gate IS the merge gate (G0.6).
|
||||
# No decorative CI: a workflow that cannot run is deleted, not committed.
|
||||
|
||||
.PHONY: help dev check lint type test vocab migrate downgrade fmt
|
||||
|
||||
help:
|
||||
@echo "make dev — app + gitea + postgres, seeded fixtures (G0.8)"
|
||||
@echo "make check — THE GATE: lint + type + test + vocab + drift"
|
||||
@echo "make migrate — alembic upgrade head"
|
||||
@echo "make fmt — ruff format + fix"
|
||||
|
||||
dev:
|
||||
docker compose up -d
|
||||
@echo "api http://localhost:8600/health/full"
|
||||
@echo "gitea http://localhost:3000"
|
||||
|
||||
check: lint type vocab test
|
||||
@echo ""
|
||||
@echo " ✓ gate passed"
|
||||
|
||||
lint:
|
||||
ruff check api scripts
|
||||
|
||||
type:
|
||||
mypy api/app --ignore-missing-imports
|
||||
|
||||
vocab:
|
||||
@python3 scripts/vocab_audit.py
|
||||
|
||||
test:
|
||||
pytest -q
|
||||
|
||||
fmt:
|
||||
ruff format api scripts
|
||||
ruff check --fix api scripts
|
||||
|
||||
migrate:
|
||||
alembic upgrade head
|
||||
|
||||
downgrade:
|
||||
alembic downgrade -1
|
||||
Reference in New Issue
Block a user