conventions/programming_general/infra_manifest.yaml
Natalie 578233c1b4 feat(infra_manifest): v0.2.0 — host∈mesh-hosts rule, broaden provider (mac/bare-metal/local)
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-29 10:10:16 -04:00

61 lines
2.8 KiB
YAML

apiVersion: conventions/v1
version: 0.2.0
updated: "2026-06-29"
name: infra_manifest
title: Per-project infra manifest (.infra.yaml)
scope: general
status: draft
summary: Every deployable project declares its infrastructure in a root .infra.yaml; `service.host` must be a host in net-tools mesh-hosts.json, so the infra-net reconciler can build the live picture. A future infra-apply renders the DO parts.
appliesTo: ["@applications/*", "@projects/@cocottetech", "@projects/@magic-civilization"]
rules:
- id: own_db
level: must
text: A project needing a database declares its own logical DB + dedicated user on the shared managed cluster (data-sourced), never reusing another service's creds.
rationale: own-DB-per-service + credential separation.
- id: http_coupling
level: must
text: Cross-service dependencies are HTTP only (declared in depends_on), never shared databases.
- id: gpu_ondemand
level: should
text: GPU workloads are on-demand — provision, keep warm while the queue is deep, release on idle. Never a standing GPU.
- id: host_in_mesh
level: must
text: "`service.host` is a host name from net-tools mesh-hosts.json (lime, fennel, redroid, …) — the infra-net reconciler validates this and regenerates the mesh-hosts services map from all .infra.yaml."
providesFile:
path: .infra.yaml
schema:
$schema: "https://json-schema.org/draft/2020-12/schema"
title: ProjectInfraManifest
type: object
additionalProperties: false
required: [apiVersion, project, provider]
properties:
apiVersion: { type: string, const: "infra/v1", description: "Manifest contract version (independent of the convention's own version)." }
project: { type: string }
provider: { type: string, enum: [digitalocean, mac, bare-metal, local], description: "Where it physically runs: digitalocean droplet, a mac (e.g. fennel), bare-metal, or local." }
database:
type: object
additionalProperties: false
required: [cluster, name, user]
properties:
cluster: { type: string, description: Shared managed cluster — data-sourced, not owned here. }
name: { type: string }
user: { type: string }
service:
type: object
additionalProperties: false
properties:
host: { type: string, description: "A host name from net-tools mesh-hosts.json (lime, fennel, redroid, …)." }
runtime: { type: string }
port: { type: integer }
systemd_unit: { type: string }
gpu:
type: object
additionalProperties: false
properties:
mode: { type: string, enum: [on-demand] }
droplet: { type: string }
depends_on:
type: array
items: { type: string }
description: Other services consumed over HTTP.