- Update docs/appctl.md to cover core_manifest.py, Schema v1.0, Class A/B source provenance, and two-axis status output. - Align docs/architecture.md, docs/secrets-and-state.md, and docs/operations.md with P1 mail topology (Stalwart on smtp.<domain>, SnappyMail in ~/Sites, workload state under ~/var/lib/homelab/<app>/). - Remove external vault path references from docs/decisions/README.md and scrub remaining personal domains/usernames across docs/ and SECURITY.md. - Extend platform genericism security invariant test to guard docs/ and root markdown/flake files.
6.5 KiB
6.5 KiB
🏛️ Homelab Core & Appctl Architecture Decision Index
This document serves as the authoritative repository index for Architectural Decision Records (ADRs) governing Homelab Core and the appctl Operational Control Plane.
Repository-level architectural decisions are recorded in docs/decisions/ using the MADR 4.0 specification. Foundational platform ADRs (0001 and 0002) are summarized inline below alongside full MADR records (0003+).
📋 Active Architectural Decisions
| Decision Record | Status | Date | Scope & One-Line Purpose |
|---|---|---|---|
| ADR-0003: Centralized Runtime Validation & Serialization via Pydantic v2 | accepted |
2026-10-15 | Adopts Pydantic v2 as the single runtime schema and validation authority across workload manifests and daemon API to enforce fail-closed type safety, strict schema-based boundaries, and secret-safe serialization. |
| ADR-0002: Homelab Operational Control Plane & Deployment Model Architecture | accepted |
2026-10-07 | Establishes appctl as the central operational control plane daemon, one logical API across dual transports (Unix socket and HTTP), explicit token authentication on host, Git as authoritative deployment state, the 5-stage model lifecycle, AI proposal boundaries, and append-only audit telemetry. |
| ADR-0001: Homelab 3-Tier Architecture & Deployment Provenance Model | accepted |
2026-09-28 | Establishes 3-tier separation (Software, OCI Artifact, Sites Deployment, Core Platform), two workload classes (Source-Backed vs. Image-Only), isolated state root (~/var/lib/homelab/<app>/), and two operational inspection axes. |
🧭 Summaries of Governing Decisions
Centralized Runtime Validation & Serialization via Pydantic v2
- Canonical Document:
0003-pydantic-v2-runtime-validation.md - Status:
accepted(Active) - Governing Implementation Plan: ROADMAP.md (Milestone P4)
- Core Commitments:
- Single Schema & Validation Layer: Workload manifests (
core_manifest.py) and API command models inherit frompydantic.BaseModel. - Fail-Closed Extra Fields (
extra="forbid"): Immediate rejection of unexpected or undocumented payload properties. - Strict Typing Policy (
strict=True): Coercion forbidden on operations, targets, identifiers, and flags. - Secret-Safe Error Transformation: Transport-level conversion of
ValidationErrorinto standardERR_VALIDATION_FAILED(400) with raw input values redacted. - Dual-Transport Parity: Identical validated models across Unix domain socket and HTTP transports.
- Single Schema & Validation Layer: Workload manifests (
Homelab Operational Control Plane & Deployment Model Architecture
- Decision ID:
ADR-0002 - Status:
accepted(Active) - Governing Implementation Plan: ROADMAP.md (Roadmap v5)
- Core Commitments:
- Control Plane Daemon:
appctltransitions from a collection of local shell scripts into the authoritative platform service (homelab-appctl.service). - One Logical API Across Dual Transports: Command-oriented operations exposed over a Unix domain socket (
/run/homelab/appctl.sock) on host and an HTTP listener for network clients. - Explicit Token Authentication Everywhere: Host SSH access does not confer appctl authority; every mutating operation requires an explicit, authenticated user-scoped token.
- Git as Authoritative Deployment State: Approved
DeploymentModelsare committed to Git.appctlacts as the reconciliation engine, validating the model, materializing platform descriptors (app.yaml+ Compose), and reconciling running containers. - Five-Stage Deployment Model Lifecycle: Separates factual
ApplicationProfile, candidateDeploymentProposal, validatedDeploymentModel(in Git), materializedDeployment Definition, and runtimeReconciliation. - AI Proposal Boundary: AI agents act strictly as proposal generators with zero mutation or execution authority. After human approval into a
DeploymentModel, the AI is completely out of the loop. - Secret Reference Invariant: Manifests contain secret references (
secretKeyRef), never secret material, resolved at runtime viaSecretProvider. - Append-Only Audit Log: Audit entries capture
principal,action,target,transport,origin,client,timestamp, andresult.
- Control Plane Daemon:
Homelab 3-Tier Architecture & Deployment Provenance Model
- Decision ID:
ADR-0001 - Status:
accepted(Active) - Governing Implementation Plan: ROADMAP.md (Roadmap v5)
- Core Commitments:
- 3-Tier Separation of Concerns:
- Tier 1 (Software Layer): Upstream application repositories owning code, tests, and CI. Zero Homelab infrastructure coupling.
- Intermediate Provenance Artifact: OCI container images produced by CI carrying commit provenance in metadata labels and content-addressed digests.
- Tier 2 (Sites Deployment Layer): Declarative manifests (
app.yaml) and Compose specs in~/Sites. - Tier 3 (Platform Core Appliance): NixOS host foundation, edge routing, SSO, and operational controllers.
- Two Workload Deployment Classes:
- Class A (Source-Backed): Declares upstream Git source and ref (
source.url,source.ref); tracks upstream Git revisions against container labels. - Class B (Image-Only): Standard third-party tools; tracks container registry image tags and digests.
- Class A (Source-Backed): Declares upstream Git source and ref (
- Isolated Persistent State Root: Mutable data lives strictly under
~/var/lib/homelab/<app>/, isolated from Git repositories. - Two Operational Inspection Axes: Local deployment checkout state evaluated independently of upstream software provenance (resolved via
git ls-remote).
- 3-Tier Separation of Concerns:
📜 Superseded Historical Decisions & Lineage
The following historical plans and design iterations have been formally superseded by the active ADRs and Roadmap v5:
- Roadmap v4 & v3 (
architecture-consolidation-roadmap-v4.md): Superseded by Roadmap v5. - appctl-v2 Modernization Plan (
appctl-engine-v2-refactoring.md): Scaffolded and absorbed into Roadmap v5 Phases P0 and P3. - Smart Selective Deployment Pipeline Plan (
smart-deployment-pipeline.md): Absorbed into Roadmap v5 Phase P4 control-plane reconciliation. - Architecture Implementation Guide v3 (
architecture-consolidation-implementation-guide-v3.md): Superseded by Roadmap v5.