From 78927beaa020cc72cdedbf21e207fb4faa1fae2d Mon Sep 17 00:00:00 2001 From: kiskaadee Date: Wed, 18 Nov 2026 22:52:46 -0500 Subject: [PATCH] docs(roadmap): reconcile Workloads transition and untrack local AGENTS.md - Add .gitignore to untrack local-only AGENTS.md, .venv, .worktrees, .internal, and repos - Remove AGENTS.md from git index (kept locally) and drop its broken link from README.md - Update README.md, profile/README.md, and ROADMAP.md from ~/Sites to ~/Workloads and split P4.5/P4.6 - Sync todo.txt with P4.5 tasks (#6-#8) and mark nixos-core#39 complete --- .gitignore | 7 ++++ AGENTS.md | 85 ----------------------------------------------- README.md | 3 +- ROADMAP.md | 9 ++--- profile/README.md | 6 ++-- todo.txt | 5 ++- 6 files changed, 20 insertions(+), 95 deletions(-) create mode 100644 .gitignore delete mode 100644 AGENTS.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..870297b --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +.worktrees +.internal +repos +AGENTS.md +.venv + +.venv diff --git a/AGENTS.md b/AGENTS.md deleted file mode 100644 index 4f9fa86..0000000 --- a/AGENTS.md +++ /dev/null @@ -1,85 +0,0 @@ -# Canopy (`canopy-homelab`) — Operations & Planning Guidelines - -This repository (`canopy-homelab/.profile`, mirrored publicly to `canopy-homelab/.github`) is the **unified workstation operations hub** and architectural planning center for the **Canopy** ecosystem. - ---- - -## 1. Workspace Topology - -- **Hub Root (`/home//Projects/active/canopy`)**: Owns ecosystem roadmap ([`ROADMAP.md`](ROADMAP.md)), cross-repo plans (`docs/plans/`), checklist ([`todo.txt`](todo.txt)), isolated worktrees (`.worktrees/`), and private incident/scratch notes (`.internal/`). -- **Nested Repositories (`repos/`, gitignored)**: - - `repos/nixos-core` (`canopy-homelab/nixos-core`): NixOS host foundation, Core platform stack, `appctl` daemon/CLI, and `gitops_dispatcher` — deployed to `/home/operator/Core` on `server`. - - `repos/kiskaadee` (`/canopy-workloads`): Unified Tier 2 workload catalog — deployed to `/home/operator/Sites` on `server`. - - `repos/ddns-monitor` (`canopy-homelab/ddns-monitor`): WAN IP rotation monitor & Cloudflare DDNS daemon. -- **Delegation**: When operating inside `repos/`, follow **both** these root operational guardrails and `/AGENTS.md`. -- **Public Mirror Boundary**: Because this repository mirrors publicly to GitHub (`canopy-homelab/.github`), **never** commit personal domains, LAN IPs, emails, or secrets here. Use SSH aliases (`server-local`, `server-remote`), `operator`, and ``; keep host-specific notes in gitignored `.internal/`. - ---- - -## 2. Remote Interaction & Server Integrity Guardrails - -### A. Local-First & Workspace Isolation -- **Never edit code or configuration files directly on the server over SSH** (`sed`, `cat <`, `fix/`, `feat/`). - -### B. Read-Only SSH Diagnostics (Permitted) -Use `ssh server-local` (LAN) or `ssh server-remote` (WAN) — or `operator@server-local` — for non-destructive inspection: -- **Logs**: `journalctl -u -n 50 --no-pager`, `docker logs --tail 50 `, `appctl logs ` -- **Status**: `systemctl status --no-pager`, `appctl list --core`, `appctl status`, `appctl info `, `docker ps -a`, `docker inspect ` -- **Network/DNS checks**: `docker exec ` - -### C. Production Execution Boundaries (Explicit User Approval Required) -To protect live infrastructure, agents **must not autonomously**: -1. **Execute production deployments** or pull changes onto the live server without explicit user authorization. -2. **Run `nixos-rebuild switch`** on the server (risks disrupting network, DNS, SOPS, or boot state). -3. **Restart or stop live production services** (`appctl up/down/restart`, `systemctl restart`, `docker restart`). -4. **Run destructive Docker/state commands** (`docker system prune -a --volumes`, deleting `~/var/lib/homelab/*` data). -5. **Mutate `/etc/` or host system files** outside declarative NixOS modules. - ---- - -## 3. Production Deployment & Handoff Policy - -When a change is validated locally and ready for the live server: -1. Present a structured **Deployment Handoff** containing: - - **Exact User Action Required**: Exact commands for the target tier (e.g. `sudo nixos-rebuild switch --flake path:/home/operator/Core#server --impure` for Core, or `appctl update/restart ` for workloads). - - **Expected Production Changes**: Services, units, or containers that will recreate or reload. - - **Expected Post-Deployment Evidence**: Health checks, socket status, HTTP codes, or log lines confirming success. - - **Verification Commands**: Read-only checks to run after execution. - - **Rollback Procedure**: Exact steps to revert (`nixos-rebuild switch --rollback`, restoring backed-up state, etc.). -2. Wait for user execution (or explicit consent to execute) before proceeding to post-deployment verification. - ---- - -## 4. CI/CD & Gitea Actions (`act_runner`) Invariants - -- **Pre-Baked Images over In-Job Installers**: Declare `container: { image: }` (e.g. `nixery.dev/shell/coreutils/git/nix/nodejs:latest`) rather than installing tools dynamically. Ensure the image includes `/bin/sleep` required by `act_runner` init. -- **Git Safe Directory**: Configure `git config --global --add safe.directory "$GITHUB_WORKSPACE"` in workflow steps when container UIDs differ. -- **No GitHub-Only API Assumptions**: Avoid third-party actions relying on `${{ github.server_url }}` resolving to `github.com`. - ---- - -## 5. Global Skill Delegation - -Operational workflows defer to the workstation's global skills (never duplicate or contradict them here): -- **Troubleshooting / RCA**: `/diagnose` -- **Git Hygiene, Branches & Commits**: `git-manager` (incremental Conventional Commits on working branches in `delivery` mode; never commit directly to `main` without explicit approval) -- **Planning & Decomposition**: `/gitea-plan` and `/implement-slice` -- **Code Review & Runtime QA**: `/code-review` and `/verify-slice` -- **Documentation**: `/document` (session insights) and `/reconcile-docs` (canonical docs) - ---- - -## 6. Organization Planning Sync Contract - -- **Authoritative Roadmap & Checklist**: [`ROADMAP.md`](ROADMAP.md), [`todo.txt`](todo.txt), and `docs/plans/` in `canopy-homelab/.profile`. -- **Organization Kanban Board**: **Canopy Platform** (`https://gitea./canopy-homelab/-/projects/7`, Project ID: `7`). -- **Canonical 5-Column Pipeline (Deep Signal)**: - - `Backlog` -> `column_id: 30` (`#475569`, default) - - `Ready` -> `column_id: 31` (`#1d76db`) - - `Work in Progress` -> `column_id: 32` (`#d97706`) - - `Review` -> `column_id: 33` (`#6d28d9`) - - `Completed` -> `column_id: 34` (`#15803d`) -- **Board Policy**: Child issues in `canopy-homelab/nixos-core` and `canopy-homelab/ddns-monitor` attach directly to Org Project `7`. -- **Mirror Policy**: Gitea (`canopy-homelab/.profile`) is primary; GitHub (`canopy-homelab/.github`) is an automated `sync_on_commit` push mirror. -- **Re-sync Trigger**: Re-run `/gitea-plan` before decomposing the next rolling milestone (P5/P6/P7) or upon scope shifts / Readiness Gates. diff --git a/README.md b/README.md index 9e93a63..177b7be 100644 --- a/README.md +++ b/README.md @@ -9,11 +9,10 @@ - [`profile/README.md`](profile/README.md): Public organization profile rendered on Gitea and GitHub. - [`ROADMAP.md`](ROADMAP.md): Authoritative Canopy ecosystem roadmap (Milestones P0–P7). - [`docs/plans/`](docs/plans/): Detailed milestone readiness, migration, and decoupling plans. -- [`AGENTS.md`](AGENTS.md): Organization guidelines and Gitea Planning Sync Contract. - [`todo.txt`](todo.txt): Active ecosystem task checklist. ## Organization Repositories - [`canopy-homelab/nixos-core`](https://gitea.roadtotech.me/canopy-homelab/nixos-core) — NixOS host foundation, Core stack, `appctl` control plane, GitOps dispatcher. - [`canopy-homelab/ddns-monitor`](https://gitea.roadtotech.me/canopy-homelab/ddns-monitor) — WAN IP rotation monitor & Cloudflare DDNS daemon. -- `kiskaadee/canopy-workloads` — Personal Tier 2 workload catalog (`~/Sites`). +- `kiskaadee/canopy-workloads` — Personal workload catalog (`~/Workloads`). diff --git a/ROADMAP.md b/ROADMAP.md index c71609d..44e3fbe 100644 --- a/ROADMAP.md +++ b/ROADMAP.md @@ -1,12 +1,12 @@ # 🗺️ Canopy Ecosystem Engineering Roadmap -This document is the authoritative **Canopy** (`canopy-homelab`) ecosystem roadmap coordinating [`canopy-homelab/nixos-core`](https://gitea.roadtotech.me/canopy-homelab/nixos-core), [`canopy-homelab/ddns-monitor`](https://gitea.roadtotech.me/canopy-homelab/ddns-monitor), and Tier 2 workload catalogs (`~/Sites`). +This document is the authoritative **Canopy** (`canopy-homelab`) ecosystem roadmap coordinating [`canopy-homelab/nixos-core`](https://gitea.roadtotech.me/canopy-homelab/nixos-core), [`canopy-homelab/ddns-monitor`](https://gitea.roadtotech.me/canopy-homelab/ddns-monitor), and workload catalogs (`~/Workloads`). --- ## 🎯 Architectural Invariants -1. **Git is the Authoritative Source of Deployment State**: All workload configurations are versioned in Git (`~/Sites`). +1. **Git is the Authoritative Source of Deployment State**: All workload configurations are versioned in Git (`~/Workloads`). 2. **One Logical API Across Dual Transports (`DEC-01`)**: `homelab-appctl.service` exposes `POST /v1/operations` + `GET /v1/health` identically over `/run/homelab/appctl.sock` and `127.0.0.1:9001`. 3. **Host Access Does Not Confer Mutation Authority (`DEC-02`)**: Mutations require an explicit Bearer token; tokenless UDS falls back strictly to `homelab-viewer`. 4. **Dedicated Service Identity & Fail-Closed Audit Guard (`DEC-03`)**: `homelab-appctl` runs isolated with mode `0600` append-only `/var/log/homelab/appctl/audit.jsonl`. @@ -25,8 +25,9 @@ This document is the authoritative **Canopy** (`canopy-homelab`) ecosystem roadm | **P2** | GitOps Hardening | `nixos-core` | ✅ **Completed** | `deployments.yaml` registry, Compose AST validator, systemd sandboxing. | | **P3** | Manifest Contract | `nixos-core` | ✅ **Completed** | Fail-closed Pydantic v2 `core_manifest.py`, two-axis provenance engine. | | **P4** | Control Plane Daemon & Host Cutover | `nixos-core` | ✅ **Completed** | `homelab-appctl.service`, 3-role RBAC, audit guard, dual-account `operator` cutover, Gitea state isolation. | -| **P4.5** | **Unified `~/Sites` & DDNS Transition** | `nixos-core`, `ddns-monitor` | 🎯 **Active Horizon** | Subpath provenance & GitOps dispatch for unified `canopy-workloads` (`~/Sites`), retire deprecated `dynu-monitor`, adopt `ddns-monitor`. | -| **P5** | **Identity, RBAC & `SecretProvider`** | `nixos-core` | ⏳ **Planned** | LLDAP directory RBAC, Authelia ForwardAuth headers, user-scoped tokens, runtime `secretKeyRef` projection. | +| **P4.5** | **Workloads Contract & Agent Readiness** | `nixos-core`, `.profile` | 🎯 **Active Horizon** | Decouple `deployments.yaml` into `~/Workloads/deployments.yaml`, provision read-only `agents` SSH user, and author `.agents/skills/new-deployment`. | +| **P4.6** | **Upstream CI/CD & Image Automation** | `nixos-core`, `.profile` | ⏳ **Planned** | Upstream-triggered CI/CD support and image update automation for workloads. | +| **P5** | **Identity, RBAC, `SecretProvider` & DDNS** | `nixos-core`, `ddns-monitor` | ⏳ **Planned** | LLDAP directory RBAC, Authelia ForwardAuth headers, user-scoped tokens, runtime `secretKeyRef` projection, and `ddns-monitor` cutover (`dynu-monitor` retirement). | | **P6** | **Canopy MCP Gateway** | `nixos-core` | ⏳ **Planned** | Standardized JSON-RPC MCP tools wrapping `appctl` with client-side human confirmation gates. | | **P7** | **Operations UI & Portal** | `nixos-core` | ⏳ **Planned** | Lightweight Operations UI client and Homepage live status integration. | diff --git a/profile/README.md b/profile/README.md index 24c08a6..be66111 100644 --- a/profile/README.md +++ b/profile/README.md @@ -11,7 +11,7 @@ | **[`canopy-homelab/.profile`](https://gitea.roadtotech.me/canopy-homelab/.profile)** | Organization profile, master roadmap, cross-repo planning, and architectural plans | [GitHub `.github`](https://github.com/canopy-homelab/.github) | | **[`canopy-homelab/nixos-core`](https://gitea.roadtotech.me/canopy-homelab/nixos-core)** | Declarative NixOS host foundation, Core platform stack, `appctl` control plane daemon, and `gitops_dispatcher` | [GitHub `nixos-core`](https://github.com/canopy-homelab/nixos-core) | | **[`canopy-homelab/ddns-monitor`](https://gitea.roadtotech.me/canopy-homelab/ddns-monitor)** | Lightweight WAN IP rotation monitor and Cloudflare DNS updater | [GitHub `ddns-monitor`](https://github.com/canopy-homelab/ddns-monitor) | -| **`/canopy-workloads`** *(Workload Tier)* | Unified Tier 2 workload catalog (`~/Sites/`) containing `app.yaml` + `docker-compose.yml` manifests | — | +| **`/canopy-workloads`** *(Workload Tier)* | Unified workload catalog (`~/Workloads/`) containing `app.yaml`, `docker-compose.yml`, and `deployments.yaml` | — | --- @@ -22,6 +22,6 @@ | **Canopy Core** (`nixos-core`) | Host OS (NixOS), Traefik ingress, Authelia/LLDAP SSO, Stalwart mail, `socket-proxy` | | **Canopy Control** (`appctl`) | Dual-transport daemon (`homelab-appctl.service`), 3-role RBAC, append-only audit guard, thin CLI | | **Canopy GitOps** (`gitops_dispatcher`) | HMAC-SHA256 webhook ingress, Compose AST security validator, serialized deployment queue | -| **Canopy Sites** (`~/Sites`) | Independently managed containerized workloads with isolated host state (`~/var/lib/homelab//`) | +| **Canopy Workloads** (`~/Workloads`) | Independently managed containerized workloads with isolated host state (`~/var/lib/homelab//`) | -See [`ROADMAP.md`](../ROADMAP.md) for current milestones (P0–P4 completed; Unified `~/Sites` + P5–P7 upcoming). +See [`ROADMAP.md`](../ROADMAP.md) for current milestones (P0–P4 completed; P4.5–P4.6 + P5–P7 upcoming). diff --git a/todo.txt b/todo.txt index 944a5ba..2cf3c6f 100644 --- a/todo.txt +++ b/todo.txt @@ -1,5 +1,8 @@ -(A) Support unified ~/Sites monorepo subpath provenance and GitOps dispatch in nixos-core +sites @nixos-core +x 2026-11-17 2026-11-17 Support unified ~/Sites monorepo subpath provenance and GitOps dispatch in nixos-core +sites @nixos-core (B) Consolidate remaining ~/Sites workloads into kiskaadee/canopy-workloads and isolate remaining data dirs to ~/var/lib/homelab +sites @workloads (B) Retire deprecated dynu-monitor and ddclient units in nixos/modules/dynu.nix +ddns @nixos-core (C) Integrate canopy-homelab/ddns-monitor for production Cloudflare WAN IP updates +ddns @ddns-monitor x 2026-11-16 (A) Complete dual-account operator cutover, Gitea state isolation, and Canopy org provisioning +p4 @canopy +x 2026-11-18 2026-11-18 Decouple deployments.yaml into ~/Workloads/deployments.yaml in nixos-core#39 +p4.5 @nixos-core +(A) 2026-11-18 Provision read-only agents SSH user in nixos-core#40 +p4.5 @nixos-core +(A) 2026-11-18 Author .agents/skills/new-deployment onboarding protocol in .profile#1 +p4.5 @canopy