- Update root README.md with Appctl Core's identity, control-plane mental model, and explicit contrast between current implementation baseline and target architecture. - Add root ROADMAP.md as repository-facing projection of Roadmap v5 (milestones P0–P7). - Add docs/decisions/README.md as lightweight navigation index for governing ADRs. - Add contextual implementation scope notes to docs/architecture.md and docs/appctl.md.
11 KiB
11 KiB
🗺️ Homelab Core & Appctl Engineering Roadmap
This document serves as the repository-facing projection of the authoritative Homelab Architecture Consolidation & Control Plane Roadmap (v5).
It describes the implementation trajectory and phased engineering milestones for transitioning Homelab Core into a unified platform driven by the appctl Operational Control Plane.
Authoritative Master Roadmap:
01-plans/homelab/consolidation/architecture-consolidation-roadmap-v5.mdin the central knowledge vault.Governing Architectural Decisions:
homelab-appctl-control-plane-architecture.md(Operational Control Plane & Deployment Model)homelab-3tier-architecture-and-provenance.md(3-Tier Architecture & Provenance)
🎯 Architectural Invariants Governing Execution
- Git is the Authoritative Source of Deployment State: All workload configurations are versioned in Git.
appctlreconciles desired Git state into running containers. - One Logical API Across Dual Transports: The control-plane API is a single logical command-oriented contract. Unix domain socket (
/run/homelab/appctl.sock) on the host and HTTP for network clients are transport details. - Host Access Does Not Confer Authority: Entering via SSH does not bypass authentication. Every mutating operation requires an explicit, authenticated user-scoped token.
- Separation of Intent from Implementation:
DeploymentModelcaptures implementation-agnostic intent; concrete platform descriptors (app.yaml+ Compose) are materialized and enforced byappctl. - AI Authoring Boundary: AI agents act strictly as proposal generators (
DeploymentProposal). Humans approve the intent (DeploymentModel). The AI possesses zero execution authority. - Secret Reference Invariant: Deployment definitions store secret references (
secretKeyRef), never plaintext material, resolved at runtime viaSecretProvider. - Clean State Root: Mutable application runtime data resides strictly under
~/var/lib/homelab/<app>/, isolated from Git repositories.
📊 Milestone Overview
| Milestone | Title | Focus Area | Status | Deliverables Summary |
|---|---|---|---|---|
| P0 | Baseline Consolidation | Git & Architecture | ✅ Completed | Synchronized refactor/appctl-rework with main, recorded control plane ADR, scaffolded v2 metadata engine. |
| P1 | Mail Topology Realignment | Topology & State | 🎯 Current / Up Next | Move Stalwart to smtp.roadtotech.me; migrate SnappyMail to ~/Sites/snappymail with zero data loss. |
| P2 | GitOps Hardening | Ingress Security | ⏳ Planned | Authoritative Core repository registry (deployments.yaml), HMAC verification, systemd execution sandboxing. |
| P3 | Manifest Contract | Domain Engine | ⏳ Planned | Schema v1.0, authoritative core_manifest.py library, source.ref semantics, two-axis status inspection. |
| P4 | Control Plane Daemon | API & Dispatch | ⏳ Planned | homelab-appctl.service daemon, dual transports (socket + HTTP), thin-client CLI, append-only audit log. |
| P5 | Identity & Secrets | Auth & Providers | ⏳ Planned | ForwardAuth header parsing, user-scoped API tokens, SecretProvider reference resolution. |
| P6 | Deployment Model & AI | Intent Authoring | ⏳ Planned | Capability catalog, DeploymentProposal \to DeploymentModel compiler, Git commit pipeline. |
| P7 | Operations UI & Portal | Client Integration | ⏳ Planned | Dedicated Operations UI client, Homepage read-only status integration widgets. |
🛠️ Detailed Milestones
Milestone P0: Baseline Consolidation
Status: ✅ Completed
- Merged
refactor/appctl-reworkandmaininto a unified architectural baseline (commit2297cd5). - Modernized metadata engine (
scripts/appctl_engine_v2.py) with strongly-typed dataclasses (SitesApp,CoreService,SourceConfig) and Docker status inspection. - Formalized the control-plane ADR and Roadmap v5 in the central knowledge vault; marked legacy roadmaps as superseded.
- Verified test suite (47 tests passing) and NixOS flake sandbox evaluation.
Milestone P1: Mail Topology Realignment & Zero-Data-Loss Migration
Status: 🎯 Current / Up Next
- Objective: Segregate platform mail routing from user-facing webmail while preserving all user data and settings.
- Key Deliverables:
- State Freeze & Verified Snapshot: Generate timestamped, SHA256-verified backup archive of
Core/config/snappymail/data. - Workload Provisioning: Scaffold
~/Sites/snappymail/(Class B Image-Only workload) and provision persistent state root at~/var/lib/homelab/snappymail/. - Zero-Data-Loss State Replication: Copy data using
cp -aand prove byte parity (diff -r). - Stalwart Re-homing: Update Stalwart public endpoint in
Core/docker-compose.ymltosmtp.roadtotech.me; remove SnappyMail from Core stack. - Live Verification: Verify webmail at
mail.roadtotech.me, user logins, address books, IMAP/SMTP routing, and Diun SMTPS delivery on port 465.
- State Freeze & Verified Snapshot: Generate timestamped, SHA256-verified backup archive of
- Exit Criteria: 100% of user data survives cutover; mail flow and Diun alert delivery confirmed.
Milestone P2: GitOps Privilege & Authority Hardening
Status: ⏳ Planned
- Objective: Close remaining trust boundaries in the webhook continuous deployment engine.
- Key Deliverables:
- Authoritative Core Registry: Establish
Core/config/deployments.yamlas the sole authority for admitted deployment repositories. - Data Vault Pull-Only Policy: Designate
~/Brainas a read-only repository withstrategy: pull-only, isolated from Docker socket access. - Compose AST Security Validator: Pre-flight parser rejecting
privileged: true, Docker socket bind mounts, host networking, and mounts outside~/var/lib/homelab/<app>/. - Systemd Sandboxing: Apply
ProtectSystem=strict,NoNewPrivileges=true, and private temporary directories tohomelab-gitops.service.
- Authoritative Core Registry: Establish
- Exit Criteria: Path traversal rejection tests pass; Compose AST security validator rejects prohibited capabilities.
Milestone P3: Manifest Contract Convergence & Provenance Engine
Status: ⏳ Planned
- Objective: Establish a single authoritative manifest schema and two-axis inspection engine across the platform.
- Key Deliverables:
- Schema v1.0 & Parser Library (
core_manifest.py): Strongly-typed manifest parsing, transport scheme validation (https://,ssh://,git@), and explicit ref semantics (moving branches vs. pinned tags vs. commit SHAs). - Two-Axis Inspection: Local deployment checkout state (
✓ Synced,* Dirty) evaluated independently of upstream software provenance (resolved viagit ls-remotebounded by a 10s timeout during--fetch). - Engine Promotion: Promote
scripts/appctl_engine_v2.pytoscripts/appctl_engine.pywith complete behavioral test coverage.
- Schema v1.0 & Parser Library (
- Exit Criteria: Manifest validation active in CI; all provenance resolution tests passing.
Milestone P4: Appctl Control Plane Daemon & Command-Oriented API
Status: ⏳ Planned
- Objective: Evolve
appctlfrom a collection of local shell scripts into the authoritative platform daemon. - Key Deliverables:
- Daemon Service (
homelab-appctl.service): Systemd daemon exposing one logical API across dual transports: Unix domain socket (/run/homelab/appctl.sock) on host and HTTP listener for network clients. - Command-Oriented Operational Router: Strongly-typed endpoints (
POST /operations/deploy,POST /operations/restart,POST /operations/pull,GET /workloads,GET /workloads/{id}/status,POST /operations/sync). - Thin-Client CLI: Re-implement
scripts/appctlas a lightweight dispatch client communicating with the local daemon socket. - Append-Only Audit Log: Record every mutating command to
~/.local/state/homelab/appctl/audit.jsonlwith restricted0600permissions. Telemetry capturesprincipal,action,target,transport,origin,client,timestamp, andresult.
- Daemon Service (
- Exit Criteria: Hermetic API test suite passing; local socket and HTTP transport tests passing; audit log correctly capturing multi-dimensional telemetry.
Milestone P5: Identity, RBAC & SecretProvider Interface
Status: ⏳ Planned
- Objective: Implement least-privilege identity boundaries and dynamic secret projection.
- Key Deliverables:
- Authentication Gateway: Accept trusted identity headers from Traefik/Authelia (
Remote-User,Remote-Groups) for web requests; validate explicit user-scoped API tokens for all CLI requests (local and remote); validate HMAC signatures for GitOps webhooks. - Role-Based Authorization Engine: Enforce group-based access control (
homelab-admin,homelab-operator,homelab-viewer). - SecretProvider Interface: Control plane resolves secret references (
secretKeyRef) at container runtime, eliminating Git history pollution for workload credentials.
- Authentication Gateway: Accept trusted identity headers from Traefik/Authelia (
- Exit Criteria: RBAC permission matrix verified by automated tests; secret references correctly materialized into runtime environments.
Milestone P6: Homelab Deployment Model & AI Authoring Workflow
Status: ⏳ Planned
- Objective: Enable safe, human-reviewed workload authoring from upstream repositories.
- Key Deliverables:
- Platform Capability Catalog: Machine-readable specification of Core capabilities and security invariants.
- DeploymentProposal Schema: Candidate model format produced by AI discovery workflows.
- DeploymentModel Git Pipeline: Operator approves proposal into a
DeploymentModel; the model is committed to the version-controlled deployment repository (Git). - Materialization & Reconciliation:
appctlvalidates the committed model, provisions state roots, compiles platform descriptors (app.yaml+ Compose), and reconciles running containers.
- Exit Criteria: Human approval gate strictly enforced; AI possesses zero execution authority; generated workloads conform to all Core invariants.
Milestone P7: Operations UI & Dashboard Integration
Status: ⏳ Planned
- Objective: Deliver a unified web-based management experience without coupling the control plane to specific frontend engines.
- Key Deliverables:
- Operations UI Client: Dedicated lightweight web client consuming the
appctlAPI for proposal review, approval, real-time log streaming, and API token management. - Homepage Status Integration: Homepage consumes live status widgets from
appctllive endpoints or compiled service maps.
- Operations UI Client: Dedicated lightweight web client consuming the
- Exit Criteria: End-to-end browser and CLI deployment verification; Homepage accurately reflecting live container health.
🔒 Verification & Quality Gates
Progress across milestones is governed by explicit verification criteria:
- Behavioral Invariant Coverage: All defined domain, authorization, deployment, and security invariants must have automated regression tests.
- Pre-Merge Validation: Every commit must pass
./scripts/test(Ruff linter + Pytest suite + Nix flake check). - Zero Production Regressions: Platform migrations must include verified pre-flight snapshots, state parity proofs, and documented rollback runbooks.