Docs/Developer Guide/Conventions & Standards

Conventions & Standards

Scope
Rules written in the repository (CONTRIBUTING.md, README.md, CI scripts) plus the deployment invariants this documentation relies on. Formatting tooling is not documented in a contributor guide (core/pom.xml carries a google-java-format.version property).
Authority
CONTRIBUTING.md. Where it cites a deeper doc it is linked below.

1. Environment invariants

RuleDetail
NamesKeep production and staging on separate domains (this site uses example.com as a placeholder). Never call a staging or local deploy "production" or "verified live".
No localhostNo browser-facing or token-issuer URL may point at localhost/127.0.0.1. Public hostnames: app. / admin. / api. / auth. (plus codeintel., builder., livekit. when used) on the environment's domain.
Baked variablesNEXT_PUBLIC_* are read at runtime; a value set at build time is baked in as a fallback. Never bake a localhost value into an image you deploy (ADR-0007).
IssuerCore must accept exactly the issuer Keycloak stamps (PUBLIC_AUTH_URL/realms/agentic-ai); extra issuers go in KEYCLOAK_ADDITIONAL_ISSUERS. See ADR-0005.
Internal exceptionContainer healthchecks, compose DNS (http://keycloak:8080, http://core:8080), JWK fetch stay as-is; do not "fix" them to the domain.
Encryption keyAPP_ENCRYPTION_KEY must be identical everywhere core boots; otherwise stored provider keys and channel secrets become undecryptable.
DeploysFollow the Deployment Guide. Flyway versions share one namespace across controlplane and tenant directories.
Never power-cycle, stop, delete or tear down a live deployment casually
No operator, CI job or automated agent should reset, reboot or stop a host, or run docker compose down on a production or shared staging stack, without an explicit human decision for that exact command. A hung deployment is evidence to collect (logs, container states, memory), not a thing to reboot: a reset is a power-yank of the tenant database.

2. Verification vocabulary

3. Database migrations (Flyway)

4. Repository hygiene gates

ScriptEnforces (CONTRIBUTING.md unless noted)
flyway-lint.shApplied-migration edit guard, destructive-DDL marker, version-collision check.
skip-expiry.shTest skips tracking a known gap carry an expiry, e.g. expires:2026-08-15, or CI fails.
InjectableConstructorTest, UniqueBeanNamesTest (core/app; make spring-wiring)Beans with several constructors and no @Autowired, duplicate Spring bean / JPA entity names (compile fine, crash core at startup).
entity-name-lint.shEntity, table, bean and controller base-path collisions.
secret-scan.shgitleaks over new commits. Never commit real keys, tokens or passwords, including in .env*.example, fixtures or docs; fake credentials go under src/test/ or *.test.*/*.spec.* (.gitleaks.toml).
check-file-size.shFile-size ratchet (hard cap 700 lines; a file over 665, within 5% of the cap, fails unless listed in the shrink-only baseline scripts/ci/file-size-baseline.txt); wired in static-gates.yml.

5. Build and deploy conventions

6. Tooling hygiene

Evidence & references