# Engineering Handoff — Codex Rules

## Principle
**Architectural integrity is P0.** No UI-specific business logic, hard-coded pilot parties, ungoverned ALTER TABLE, opaque JSON-only transaction model, or fake API contracts.

## Recommended baseline
.NET 10 ASP.NET Core Web API; SQL Server relational-first; modular monolith with strict module boundaries; Vue 3 experience shell with renderer contracts for other frameworks; RabbitMQ/transactional outbox for eventual asynchronous integrations. Blockchain is an adapter, not a prerequisite of business execution.

## Vertical-slice process
1. Write an ADR for architectural decisions and identify configurable vs programmed behaviors.
2. Define contract, data model, versioned metadata, auth, expected events and exception cases.
3. Build small end-to-end slice across database/API/application/runtime/optional UI.
4. Tests: tenant isolation, RBAC/ABAC, concurrency, API-only operation, audit, idempotency, duplicate ingest, contract & migration safety.
5. Update changelog, examples, OpenAPI and this documentation site at the same time as code.
6. Do not proceed on unresolved business policy as if approved.

## Practical first slices
Identity/organizations; metadata model+field definition with safe publish; headless CRUD runtime backed by governed relational schema; field validation; manual/API unified ingest; initial lot lineage; outbox/audit; workbench renderer.

## Responsibility division
This repository is for the public-facing documentation portal. Code implementation may live in a separate development repository. Documents published to Cloudflare must not contain secret tokens, private credentials or regulated personal data. A private GitHub repo DOES NOT automatically make the deployed website private.
