Compare commits

..
5 Commits
Author SHA1 Message Date
kiskaadee dc47898a9b plan(brain): specify anne droid agent persona and gitea integration
Brain Structural Validation / Validate Markdown Structure & Links (push) Successful in 8s
- Specify persona architecture, authority boundaries, and review gates for Anne Droid.
- Define Gitea forge integration, feat/anne/* branch convention, and PR review checklist.
2026-10-08 00:09:20 -05:00
kiskaadee f0f4c31811 plan(homelab): define architecture consolidation and control plane roadmap v5
- Add comprehensive v5 roadmap unifying appliance baseline and phases P0-P4 for the appctl control plane.
- Mark superseded plans (roadmap v4, implementation guide v3, appctl engine v2, and smart deployment pipeline) with forward references to roadmap v5.
2026-10-08 00:04:59 -05:00
kiskaadee 2f71cd23e8 decision(homelab): adopt daemon control plane architecture and typed execution engine
- Establish ADR transitioning appctl from ad-hoc host CLI execution to a stateful control-plane daemon (appctld).
- Define Unix domain socket / mTLS transport, typed provenance domain models, and decoupled CLI ergonomics.
- Isolate unprivileged interactive commands from root-level container orchestration.
2026-10-08 00:03:56 -05:00
kiskaadee dde63d6e13 decision(brain): adopt pedagogical decoupling and governance for agent skills
- Establish architectural decision separating portable core skills from vault extensions.
- Codify human-in-the-loop apprenticeship guardrails ("Your call") to prevent comprehension illusions.
- Mandate public domain licensing (Unlicense) and semantic path resolution.
2026-10-08 00:03:02 -05:00
kiskaadee e9c461d6fc journal: record daily log for 2026-10-05
- Document engineering wins around skills repository decoupling, learning theory, and unlicense adoption.
- Record journal-builder specification, formative feedback loop, and second brain sync.
- Log graphify A/B benchmark review against bdinvite codebase.
2026-10-07 23:56:35 -05:00
9 changed files with 887 additions and 5 deletions

No files matched your search

@@ -0,0 +1,174 @@
---
type: plan
status: active
project: brain
date: 2026-10-07
tags:
- agent-architecture
- persona
- gitea
- frontend
- multi-agent
---
# Anne Droid Agent Persona & Gitea Integration Roadmap
> **Target System**: Local Antigravity development environment and self-hosted Gitea forge (`gitea.roadtotech.me`).
> **Role & Persona**: Anne Droid — Senior Frontend Engineer & UX Specialist.
---
## Executive Summary
This plan operationalizes **Anne Droid** as an autonomous, persistent engineering collaborator for Frontend development, user interface interaction, and UX review. Anne is not a procedural skill; she is an agent persona with dedicated authority boundaries, isolated Gitea credentials, and genuine version control provenance.
The primary operational outcomes:
1. Genuine forge provenance on `gitea.roadtotech.me` via dedicated user `anne-droid`, ed25519 SSH authentication on port 2223, and `tea` CLI integration.
2. Safe Branch & PR Autonomy: Anne implements UI code on `feat/anne/*` branches and opens PRs without having permission to commit to `main`, merge PRs, or alter backend logic autonomously.
3. A formal "Frontend → Backend Feedback" loop providing structured, consumer-perspective reviews of backend endpoints and schemas.
4. Clean integration within the portable skills repository (`profile/agents/anne-droid.md`) and Antigravity subagent registry.
---
## 1. Technical Specifications & Contracts
### System Topology
```mermaid
flowchart TD
User["Human Lead / Backend Engineer"]
MainAgent["Main Agent (Orchestrator)"]
AnneSubagent["Anne Droid (Subagent)"]
GiteaForge["Gitea Forge (gitea.roadtotech.me:2223)"]
RepoWorkspace["Local Project Workspace"]
User <-->|"Architectural Review & Merges"| MainAgent
MainAgent -->|"Consult (Advisory Mode)"| AnneSubagent
MainAgent -->|"Delegate (Implementation Mode)"| AnneSubagent
AnneSubagent -.->|"API Friction Report / UX Audit"| MainAgent
AnneSubagent -->|"Branch: feat/anne/*"| RepoWorkspace
AnneSubagent -->|"Commit: Author Anne Droid"| RepoWorkspace
AnneSubagent -->|"Push: SSH Key id_ed25519_anne_droid"| GiteaForge
AnneSubagent -->|"PR Creation: tea CLI"| GiteaForge
GiteaForge -->|"Code Review & PR Merge"| User
```
### Component Taxonomy & Authority Matrix
| Domain | Action | Permitted? | Constraints / Execution Rule |
| :--- | :--- | :--- | :--- |
| **Git Branches** | Create / Checkout | ✅ Yes | Naming strictly constrained to `feat/anne/*`, `fix/anne/*`, `ux/anne/*` |
| **Git Commits** | Author commit | ✅ Yes | Conventional Commits; authored as `Anne Droid <anne-droid@roadtotech.me>` |
| **Git Remote** | Push | ✅ Yes | Allowed only to own feature branches on remote forge |
| **Git PRs** | Open / Update | ✅ Yes | Opened via `tea pr create --login anne-droid` with descriptive summaries |
| **Git Governance**| Direct commit to `main` | ❌ No | Strictly forbidden; raises hard constraint failure |
| **Git Governance**| Merge PRs | ❌ No | Strictly forbidden; only repository owner merges into `main` |
| **Git Safety** | Destructive git commands | ❌ No | Strictly forbidden (`reset --hard`, force-push, `clean -fd`) |
| **Code Scope** | Frontend components & CSS | ✅ Yes | React, HTML, CSS, client styling, client unit/integration tests |
| **Code Scope** | Backend & Database code | ❌ No | Read-only access to inspect contracts; no unilateral modifications |
| **Architecture** | API Feedback | ✅ Yes | Emits advisory "Frontend → Backend Feedback" reports or opens issues |
| **Infrastructure** | System / Deploy / NixOS | ❌ No | Strictly forbidden |
### Git & Forge Authentication Contract
- **Forge User**: `anne-droid` (ID 2 on `https://gitea.roadtotech.me`).
- **SSH Key Pair**: `~/.ssh/id_ed25519_anne_droid` (Public Key ID 3 on Gitea).
- **SSH Transport**: Scoped command bypassing global Nix-managed config:
```bash
GIT_SSH_COMMAND="ssh -F /dev/null -p 2223 -i ~/.ssh/id_ed25519_anne_droid -o IdentitiesOnly=yes"
```
- **Commit Identity Variables**:
```bash
GIT_AUTHOR_NAME="Anne Droid"
GIT_AUTHOR_EMAIL="anne-droid@roadtotech.me"
GIT_COMMITTER_NAME="Anne Droid"
GIT_COMMITTER_EMAIL="anne-droid@roadtotech.me"
```
- **CLI Management**: Authenticated profile in `tea` CLI:
```bash
tea login add --name anne-droid --url https://gitea.roadtotech.me --token <TOKEN>
```
---
## 2. Working Rules & Coordination Constraints
1. **One Owner per Capability**:
Anne does not duplicate procedural skills. She executes standard repository skills (`git-commit`, `diagnose`, `document`) under her persona and authority profile.
2. **Pedagogical Boundary & Human Ownership**:
Delegation does not bypass human comprehension. The human lead reviews diffs and owns PR merge decisions.
3. **Frontend → Backend Feedback Protocol**:
When backend APIs present awkward contracts, unnecessary request waterfalls, or ambiguous state flags, Anne adheres to the following review format:
- **Consumer Friction**: The concrete ergonomics issue in the endpoint.
- **Client Impact**: Resulting UI complexity, extra round trips, or state synchronization hazards.
- **Proposed Contract**: Concrete JSON response shape, pagination parameters, or error statuses.
- **Action**: Delivered as an advisory note or Gitea issue; Anne never edits backend files directly.
4. **Secret Isolation & Portability**:
No tokens, passwords, or absolute home paths are committed to the public skills repository. All persona rules use relative or tilde-expanded paths.
---
## 3. Phased Implementation Roadmap
| Phase | Status | Deliverables | Verification Gates |
| :--- | :--- | :--- | :--- |
| **P0: Forge Identity & Keys** | Completed | User `anne-droid`, SSH key pair, public key upload | `ssh -p 2223 git@gitea.roadtotech.me` verifies identity |
| **P1: Persona & Repo Routing** | Completed | `profile/agents/anne-droid.md`, `profile/AGENTS.md`, `install.sh` | `./install.sh check` clean, conventional commit in `main` |
| **P2: Subagent Registration** | Completed | Antigravity `anne_droid` subagent definition | `define_subagent` registers successfully |
| **P3: CLI Token & PR Automation** | Pending (User) | Gitea access token in `tea` login profile | `tea --login anne-droid whoami` returns `anne-droid` |
| **P4: End-to-End Dogfood Run** | Pending | Advisory API audit & delegated branch implementation | Real PR opened on Gitea authored by `anne-droid` |
---
## 4. Execution Runbook
### Step 1: Token Configuration (User-facing)
1. In Gitea web interface (`https://gitea.roadtotech.me`), generate an application token for `anne-droid` with `repo` scope.
2. Register the token in `tea`:
```bash
tea login add --name anne-droid --url https://gitea.roadtotech.me --token <TOKEN>
```
3. Confirm authentication:
```bash
tea --login anne-droid whoami
```
### Step 2: Delegated Feature Implementation (Agent runbook)
1. Create and switch to feature branch:
```bash
git checkout -b feat/anne/<feature-name>
```
2. Implement frontend components, styles, and unit tests.
3. Commit with Anne's metadata:
```bash
GIT_AUTHOR_NAME="Anne Droid" \
GIT_AUTHOR_EMAIL="anne-droid@roadtotech.me" \
GIT_COMMITTER_NAME="Anne Droid" \
GIT_COMMITTER_EMAIL="anne-droid@roadtotech.me" \
git commit -m "feat(ui): <description>"
```
4. Push branch to remote:
```bash
GIT_SSH_COMMAND="ssh -F /dev/null -p 2223 -i ~/.ssh/id_ed25519_anne_droid -o IdentitiesOnly=yes" \
git push -u origin feat/anne/<feature-name>
```
5. Open PR via `tea`:
```bash
tea pr create --login anne-droid --title "feat(ui): <title>" --description "..."
```
---
## 5. Definition of Done
- [x] Gitea account `anne-droid` created and verified.
- [x] Dedicated SSH key pair generated and registered to Gitea.
- [x] SSH connection over port 2223 verified with successful welcome banner.
- [x] Persona specification written to `profile/agents/anne-droid.md`.
- [x] Global routing table in `profile/AGENTS.md` updated.
- [x] `install.sh` updated and symlink verified in `~/.gemini/config/agents/`.
- [x] Antigravity subagent `anne_droid` registered.
- [ ] Gitea API token added to `tea` CLI login configuration.
- [ ] First end-to-end pull request created on Gitea authored by Anne Droid.
@@ -1,6 +1,6 @@
--- ---
type: plan type: plan
status: active status: superseded
project: homelab project: homelab
date: 2026-09-21 date: 2026-09-21
tags: tags:
@@ -16,6 +16,8 @@ tags:
# 🚀 appctl Engine V2: Architectural Modernization & Type-Safe Refactoring Plan # 🚀 appctl Engine V2: Architectural Modernization & Type-Safe Refactoring Plan
> **Superseded by**: [Architecture Consolidation & Control Plane Roadmap v5](../consolidation/architecture-consolidation-roadmap-v5.md) (specifically Phases P0, P3, and P4). Engine modernization code has been integrated into the consolidated baseline and control-plane architecture.
## 1. Executive Summary & Intent ## 1. Executive Summary & Intent
The `appctl` control utility is the central metadata, discovery, and inspection engine for the `roadtotech.me` homelab. It derives operational views (Docker status, Git sync status, SSL/TLS validation, Homepage dashboard generation, shell completion) from application manifests (`Sites/*/app.yaml`) and Core platform definitions. The `appctl` control utility is the central metadata, discovery, and inspection engine for the `roadtotech.me` homelab. It derives operational views (Docker status, Git sync status, SSL/TLS validation, Homepage dashboard generation, shell completion) from application manifests (`Sites/*/app.yaml`) and Core platform definitions.
@@ -1,6 +1,6 @@
--- ---
type: plan type: plan
status: active status: superseded
project: homelab project: homelab
tags: tags:
- operations - operations
@@ -14,6 +14,8 @@ tags:
# 🚀 Smart Selective Deployment Pipeline Plan for Homelab Core # 🚀 Smart Selective Deployment Pipeline Plan for Homelab Core
> **Superseded by**: [Architecture Consolidation & Control Plane Roadmap v5](../consolidation/architecture-consolidation-roadmap-v5.md) (specifically Phase P4 control-plane reconciliation).
## Goal Description ## Goal Description
Implement an intelligent, change-aware deployment pipeline for `homelab-core` that: Implement an intelligent, change-aware deployment pipeline for `homelab-core` that:
1. Analyzes incoming commits on `main` (via Gitea GitOps webhooks and manual `appctl update core` CLI invocations) and selectively executes **only** the required actions. 1. Analyzes incoming commits on `main` (via Gitea GitOps webhooks and manual `appctl update core` CLI invocations) and selectively executes **only** the required actions.
@@ -1,7 +1,7 @@
--- ---
type: plan type: plan
status: superseded status: superseded
superseded_by: architecture-consolidation-roadmap-v4.md superseded_by: architecture-consolidation-roadmap-v5.md
project: homelab project: homelab
tags: tags:
- architecture - architecture
@@ -16,7 +16,7 @@ tags:
# Homelab Core — Architecture Consolidation & Hardening Implementation Guide v3 # Homelab Core — Architecture Consolidation & Hardening Implementation Guide v3
> [!WARNING] > [!WARNING]
> **SUPERSEDED**: This execution guide has been superseded by [**Architecture Consolidation & Hardening Roadmap & Execution Plan v4**](architecture-consolidation-roadmap-v4.md), which unifies the architecture specifications and step-by-step implementation runbooks into a single source of truth. > **SUPERSEDED**: This execution guide has been superseded by [**Architecture Consolidation & Control Plane Roadmap v5**](architecture-consolidation-roadmap-v5.md), which unifies the architecture specifications and step-by-step implementation runbooks into a single source of truth.
> >
> **Target System**: `roadtotech.me` (NixOS appliance `Core/`, application workloads `Sites/`) > **Target System**: `roadtotech.me` (NixOS appliance `Core/`, application workloads `Sites/`)
> >
@@ -1,6 +1,6 @@
--- ---
type: plan type: plan
status: active status: superseded
project: homelab project: homelab
tags: tags:
- architecture - architecture
@@ -15,6 +15,8 @@ tags:
# Architecture Consolidation & Hardening Roadmap & Execution Plan v4 # Architecture Consolidation & Hardening Roadmap & Execution Plan v4
> **Superseded by**: [Architecture Consolidation & Control Plane Roadmap v5](architecture-consolidation-roadmap-v5.md)
>
> **Supersedes**: [Architecture Consolidation & Hardening Roadmap v3](architecture-consolidation-roadmap-v3.md) and [Architecture Consolidation Implementation Guide v3](architecture-consolidation-implementation-guide-v3.md) > **Supersedes**: [Architecture Consolidation & Hardening Roadmap v3](architecture-consolidation-roadmap-v3.md) and [Architecture Consolidation Implementation Guide v3](architecture-consolidation-implementation-guide-v3.md)
> >
> **Current Platform Baseline**: Commit `246b587` (NixOS standalone appliance, consolidated docs, Portainer deprecated, Stalwart mail & SMTPS submission, Dozzle auth, Diun jitter/worker pool, Gitea Actions CI). > **Current Platform Baseline**: Commit `246b587` (NixOS standalone appliance, consolidated docs, Portainer deprecated, Stalwart mail & SMTPS submission, Dozzle auth, Diun jitter/worker pool, Gitea Actions CI).
@@ -0,0 +1,249 @@
---
type: plan
status: active
project: homelab
tags:
- architecture
- security
- operations
- homelab
- gitops
- appctl
- control-plane
- roadmap
- consolidation
- provenance
---
# Architecture Consolidation & Control Plane Roadmap v5
> **Supersedes**: [Architecture Consolidation Roadmap v4](architecture-consolidation-roadmap-v4.md) and [appctl Engine V2 Refactoring Plan](../appctl/appctl-engine-v2-refactoring.md)
>
> **Current Platform Baseline**: Consolidated Git baseline combining NixOS appliance (`Core/`), modernized type-safe metadata engine (`appctl-v2`), and validated provenance domain models.
>
> **Architectural Decision Records**:
> - [`homelab-3tier-architecture-and-provenance.md`](../../../03-records/decisions/homelab-3tier-architecture-and-provenance.md)
> - [`homelab-appctl-control-plane-architecture.md`](../../../03-records/decisions/homelab-appctl-control-plane-architecture.md)
>
> **Target System**: `roadtotech.me` (NixOS appliance `Core/`, application workloads `Sites/`, persistent state `~/var/lib/homelab/`)
---
## Executive Summary
Roadmap v5 establishes the unified engineering roadmap for Homelab Core. It integrates the **3-Tier Architecture & Provenance Model** with the transition of **`appctl` into the authoritative Homelab Core Operational Control Plane**.
Under this roadmap, `appctl` is no longer a collection of local shell scripts invoked over SSH; it is an authenticated, command-oriented control plane daemon exposed over Unix domain socket and HTTP. The platform maintains **Git as the authoritative declarative truth for deployment state**, reconciles implementation-agnostic **Deployment Models**, projects secrets via a provider interface, and serves heterogeneous clients (local CLI, remote CLI, GitOps dispatcher, Operations UI, and AI authoring workflows) with complete telemetry.
---
## 1. System Topology & Control Plane Architecture
```mermaid
flowchart TB
subgraph CLIENTS["1. CLIENT PLANE"]
direction LR
CLI_REMOTE["Remote CLI<br/>(Bearer Token via HTTP)"]
CLI_LOCAL["Local CLI (Host)<br/>(Bearer Token via Unix Socket)"]
GITOPS_DISPATCH["GitOps Dispatcher<br/>(HMAC-SHA256 via HTTP)"]
UI_OPS["Operations Web UI<br/>(ForwardAuth via HTTP)"]
AI_AGENT["AI Authoring Workflow<br/>(Proposal Generator)"]
end
subgraph CONTROL_PLANE["2. HOMELAB OPERATIONAL CONTROL PLANE (appctl Daemon)"]
direction TB
subgraph TRANSPORTS["Transport Listeners (One Logical API)"]
SOCKET_IN["Unix Domain Socket (/run/homelab/appctl.sock)"]
HTTP_IN["HTTP Listener (Localhost / LAN / Traefik)"]
end
API_ROUTER["Command-Oriented Operational Router<br/>• POST /operations/deploy<br/>• POST /operations/restart<br/>• GET /workloads & status<br/>• POST /operations/sync"]
subgraph CORE_MODULES["Core Daemon Subsystems"]
AUTH_MODULE["Identity & RBAC (LLDAP / Groups)"]
AUDIT_MODULE["Append-Only Audit Log (Telemetry & Hashes)"]
MODEL_VALIDATOR["DeploymentModel Validator & Compiler"]
SECRET_PROVIDER["SecretProvider Interface (Secret References)"]
RECON_ENGINE["Reconciliation & Compose Driver"]
end
SOCKET_IN --> API_ROUTER
HTTP_IN --> API_ROUTER
API_ROUTER --> AUTH_MODULE
AUTH_MODULE --> AUDIT_MODULE
API_ROUTER --> MODEL_VALIDATOR
MODEL_VALIDATOR --> SECRET_PROVIDER
SECRET_PROVIDER --> RECON_ENGINE
end
subgraph PLATFORM_RUNTIME["3. PLATFORM & RUNTIME TIERS"]
direction LR
GIT_REPO["Deployment Catalog (Git Truth)<br/>• Versioned DeploymentModels"]
SITES_CATALOG["Sites Catalog (~/Sites/*)<br/>• Materialized app.yaml & compose"]
STATE_ROOT["Host State Root (~/var/lib/homelab/*)<br/>• Workload Data & DBs"]
DOCKER_ENGINE["Docker Daemon & Socket-Proxy"]
TRAEFIK_INGRESS["Traefik Edge & TLS Ingress"]
end
CLIENTS --> TRANSPORTS
MODEL_VALIDATOR --> GIT_REPO
GIT_REPO --> SITES_CATALOG
RECON_ENGINE --> SITES_CATALOG
RECON_ENGINE --> DOCKER_ENGINE
SITES_CATALOG --> STATE_ROOT
DOCKER_ENGINE --> TRAEFIK_INGRESS
```
---
## 2. Core Architectural Invariants
1. **One Logical API Across Transports**: The control-plane API is a single logical command-oriented contract. Unix domain socket vs. HTTP is merely transport. Local and remote CLIs invoke identical operation schemas.
2. **Host Access Does Not Confer Authority**: Entering via SSH does not bypass control-plane authentication. **Every mutating operation requires an explicit, authenticated user-scoped token.**
3. **Git is the Authoritative Source of Deployment State**: Approved `DeploymentModels` are committed to the version-controlled deployment repository. `appctl` reconciles desired Git state into running containers, preserving rollback capability (`git revert`) and historical auditability.
4. **Five-Stage Model Lifecycle (Intent vs. Implementation)**:
$$\text{Repository} \xrightarrow{\text{Investigation}} \text{Application Profile} \xrightarrow{\text{Proposal}} \text{DeploymentProposal} \xrightarrow{\text{Human Selection}} \text{DeploymentModel (Git)} \xrightarrow{\text{appctl Materialize}} \text{Deployment Definition} \xrightarrow{\text{Reconcile}} \text{Containers}$$
`DeploymentModel` captures implementation-agnostic intent (ports, domains, volumes, dependencies); `Deployment Definition` captures the concrete platform descriptors (`app.yaml` + Compose).
5. **AI Authoring Boundary**: The AI is strictly an upstream authoring client with zero mutation authority. The AI analyzes repositories and emits `DeploymentProposals`. After human approval, the AI is completely out of the loop.
6. **KISS Primitives & Linear Control Paths**: The deployment pipeline remains strictly linear:
$$\text{Source Push} \longrightarrow \text{CI Build} \longrightarrow \text{GitOps Ingress} \longrightarrow \text{appctl Reconcile} \longrightarrow \text{Compose Up}$$
No distributed message brokers or deployment databases.
7. **Secret Reference Invariant**: Deployment definitions contain secret references (`secretKeyRef`), never secret material. References are resolved at runtime via the `SecretProvider` interface.
8. **Clean Persistent State Root**: Mutable application data lives strictly under `~/var/lib/homelab/<app>/`, isolated from Git repositories.
9. **Client Independence**: `appctl` owns the control-plane contract, not its clients. Homepage is a read-only dashboard consumer, not an interactive administration cockpit.
---
## 3. Phased Implementation Roadmap
### Overview
| Phase | Title | Focus Area | Key Deliverables | Verification Gates |
| :--- | :--- | :--- | :--- | :--- |
| **P0** | **Baseline Consolidation** | Git & Architecture | Merge `refactor/appctl-rework` into `main`, unify history, supersede old plans. | Clean git working tree, `./scripts/test` passing, flake check green. |
| **P1** | **Mail Realignment** | Topology & State | Move Stalwart to `smtp.roadtotech.me`, SnappyMail to `~/Sites/snappymail`. | Zero data loss, verified rollback archive, state parity diff, Diun SMTPS delivery. |
| **P2** | **GitOps Hardening** | Ingress Security | Authoritative Core repo registry, HMAC validation, systemd sandboxing. | Flake check, path traversal rejection tests, Compose AST security validator. |
| **P3** | **Manifest Contract** | Domain Engine | Schema v1.0, `core_manifest.py`, source provenance resolution (`git ls-remote`). | Regression tests for domain invariants, schema linting in CI. |
| **P4** | **Control Plane Daemon** | API & Dispatch | `homelab-appctl.service`, dual transport (socket + HTTP), thin-client CLI, append-only audit log. | Hermetic API test suite, explicit token validation tests, audit log telemetry verification. |
| **P5** | **Identity & Secrets** | Auth & Providers | Authelia header auth, user-scoped API tokens, `SecretProvider` reference resolver. | RBAC permission matrix tests, secret reference materialization tests. |
| **P6** | **Deployment Model & AI**| Intent Authoring | Capability model, `DeploymentProposal` $\to$ `DeploymentModel` compiler, Git commit pipeline. | Intent validation tests, platform security invariant enforcement tests. |
| **P7** | **Operations UI & Portal** | Client Integration | Dedicated Operations UI client, Homepage status integration widgets. | End-to-end deployment verification via UI and CLI. |
---
### Phase 0: Baseline & Architectural Consolidation (Completed)
* **Deliverable 0.1**: Record Architectural Decision Record (`homelab-appctl-control-plane-architecture.md`).
* **Deliverable 0.2**: Merge `refactor/appctl-rework` into `main` and synchronize baseline back to working branch.
* **Deliverable 0.3**: Mark superseded roadmaps (v2, v3, v4) and legacy refactoring plans as `status: superseded`.
* **Deliverable 0.4**: Run `./scripts/test` and `nix flake check` to confirm baseline integrity.
---
### Phase 1: Mail Topology Realignment & Zero-Data-Loss Migration Runbook
* **Deliverable 1.1: Pre-Migration Snapshot**:
Freeze SnappyMail container, generate timestamped SHA256-verified backup archive of `Core/config/snappymail/data`.
* **Deliverable 1.2: Workload Provisioning & State Cutover**:
- Provision `~/var/lib/homelab/snappymail/`.
- Replicate state with `cp -a` and prove byte parity (`diff -r`).
- Create `~/Sites/snappymail/app.yaml` (Class B Image-Only) and `docker-compose.yml`.
* **Deliverable 1.3: Stalwart Endpoint Re-homing**:
Update Stalwart public Traefik labels in `Core/docker-compose.yml` to `smtp.roadtotech.me`. Remove SnappyMail from Core stack.
* **Deliverable 1.4: Cutover Verification**:
Verify webmail logins, address book persistence, IMAP/SMTP mail flow, and Diun SMTPS alert delivery on port 465.
---
### Phase 2: GitOps Privilege & Authority Hardening
* **Deliverable 2.1: Authoritative Core Repository Registry**:
Define `Core/config/deployments.yaml` as the sole authority for admitted deployment targets.
* **Deliverable 2.2: Second Brain Read-Only Data Vault Policy**:
Designate `~/Brain` with `strategy: pull-only`, isolated from Docker execution.
* **Deliverable 2.3: Workload Compose Security Policy**:
Implement pre-flight Compose AST inspection rejecting privileged containers, Docker socket mounts, and host root mounts.
* **Deliverable 2.4: Systemd Service Sandboxing**:
Apply `ProtectSystem=strict`, `NoNewPrivileges=true`, and private temporary directories to `homelab-gitops.service`.
---
### Phase 3: Manifest Contract Convergence & Provenance Engine
* **Deliverable 3.1: Manifest Schema v1.0 & Authoritative Parser (`core_manifest.py`)**:
- Implement strongly-typed domain dataclasses: `SitesApp`, `CoreService`, `SourceConfig`.
- Enforce explicit `source.ref` semantics: moving branch (`main`), release tag (`v1.2.3`), immutable commit SHA (`a1b2c3...`).
- Strict transport scheme validation: permitted `https://`, `ssh://`, `git@`; reject `file://` and path traversals.
* **Deliverable 3.2: Two-Axis Inspection**:
- Axis 1: Local Sites deployment checkout state (`✓ Synced`, `* Dirty`, `⬆ Ahead`, `⬇ Behind`).
- Axis 2: Upstream software provenance state (via `git ls-remote` bounded by 10s timeout during `--fetch`).
* **Deliverable 3.3: Engine Promotion**:
Promote `scripts/appctl_engine_v2.py` to `scripts/appctl_engine.py` with complete behavioral test coverage.
---
### Phase 4: appctl Control Plane Daemon & Command-Oriented API
* **Deliverable 4.1: Control Plane Service (`homelab-appctl.service`)**:
Implement command-oriented daemon listening on dual transports: Unix domain socket (`/run/homelab/appctl.sock`) for local host clients and unified HTTP listener (localhost, LAN, and Traefik edge ingress) for network clients.
* **Deliverable 4.2: Command-Oriented Operational Endpoints**:
- `POST /operations/deploy` (reconcile deployment for target workload)
- `POST /operations/restart` (restart workload containers)
- `POST /operations/pull` (pull latest images)
- `GET /workloads` (list workloads with two-axis inspection)
- `GET /workloads/{id}/status` (inspect specific workload diagnostics)
- `GET /workloads/{id}/logs` (stream logs via Server-Sent Events)
- `POST /operations/sync` (recompile dashboard status)
* **Deliverable 4.3: Thin-Client CLI**:
Update `scripts/appctl` to act as a lightweight client dispatching commands to the local daemon socket with zero duplicate operational code.
* **Deliverable 4.4: Append-Only Audit Log**:
Record every mutating command to `~/.local/state/homelab/appctl/audit.jsonl` with restricted `0600` permissions. Telemetry captures `principal`, `action`, `target`, `transport`, `origin`, `client`, `timestamp`, and `result`.
---
### Phase 5: Identity, RBAC & SecretProvider Interface
* **Deliverable 5.1: Authentication Gateway**:
- Web requests: Accept trusted identity headers from Traefik/Authelia (`Remote-User`, `Remote-Groups`).
- CLI requests (both remote and local): Require explicit user-scoped API tokens (`Authorization: Bearer <token>`).
- Webhook requests: Validate HMAC-SHA256 signature against webhook secret.
* **Deliverable 5.2: Role-Based Authorization Engine**:
Enforce group policies (`homelab-admin`, `homelab-operator`, `homelab-viewer`) on incoming operations.
* **Deliverable 5.3: SecretProvider Interface**:
- Define `SecretProvider` contract in the control plane:
```python
class SecretProvider(Protocol):
def resolve_secret(self, ref: str) -> str: ...
def project_environment(self, refs: dict[str, str]) -> dict[str, str]: ...
```
- Deployment definitions store secret references (`secretKeyRef: ...`), never plaintext material.
- Workload application secrets are projected dynamically at container recreation without Git history pollution.
---
### Phase 6: Homelab Deployment Model & AI Authoring Workflow
* **Deliverable 6.1: Platform Capability Catalog & Invariants**:
Formally define machine-readable specification of Core capabilities (HTTP routing, persistent mounts, networks, healthchecks) and invariants (no privileged containers, isolated state root).
* **Deliverable 6.2: `DeploymentProposal` Schema**:
Define candidate model structure emitted by AI discovery workflows from repository inspection.
* **Deliverable 6.3: `DeploymentModel` Git Pipeline & Materialization**:
- Operator selects/edits proposal into an approved `DeploymentModel`.
- The model is committed to the version-controlled deployment repository (Git).
- `appctl` validates the model, provisions `~/var/lib/homelab/<app>/`, compiles the Deployment Definition (`app.yaml` + Compose), and triggers deployment.
* **Deliverable 6.4: Human Approval Invariant**:
Enforce interactive operator signature/approval before model creation. AI possesses zero execution authority.
---
### Phase 7: Operations Web Client & Dashboard Integration
* **Deliverable 7.1: Operations UI Client**:
Deploy lightweight, browser-based management console as a client of the control plane API (proposals review, approval, real-time log streaming, token management).
* **Deliverable 7.2: Homepage Status Integration**:
Maintain Homepage as read-only portal, querying `appctl` live status endpoints or compiled `services.yaml`.
---
## 4. Definition of Done
1. **Unified Control Plane**: All platform operations execute through `homelab-appctl.service`. No secondary deployment scripts exist.
2. **Explicit Authentication Everywhere**: Host SSH access does not confer appctl authority. Every operation has an authenticated principal and is recorded in the append-only audit log with transport and origin telemetry.
3. **Declarative Git Truth**: All workloads are governed by version-controlled `DeploymentModels` committed to Git. Deployments are fully reproducible and auditable.
4. **Secret Hygiene**: Deployment manifests contain zero plaintext credentials; workload secrets resolve via `SecretProvider` without Git history pollution.
5. **Safe Deployment Authoring**: AI agents act strictly as proposal generators; all mutations require human approval and conform to Core invariants.
6. **Zero Data Loss**: Mail realignment preserves 100% of user data, mailboxes, and address books.
7. **Invariant-Driven Regression Coverage**: All defined domain, authorization, deployment, and security invariants have automated regression coverage.
@@ -0,0 +1,105 @@
---
type: decision
status: accepted
project: brain
date: 2026-10-05
tags:
- agent-architecture
- skills
- learning-workflow
- human-in-the-loop
- software-apprenticeship
---
# Agent Skills Pedagogical Decoupling and Governance
## Context and Problem Statement
As a career-changer learning software engineering by building real systems, standard industry agent workflows often prioritize automated code generation over engineer comprehension. This introduces an insidious risk: making it too easy to delegate away the exact engineering decisions, architectural trade-offs, and mental debugging models necessary for true skill acquisition.
Concurrently, repository skills had accumulated substantial operational coupling:
1. Skills were duplicated across multiple out-of-sync locations (`~/.gemini/config/skills`, `~/Brain/05-agents/skills`, and global `AGENTS.md` instructions).
2. Trivial slash command wrappers (`practice`, `diagnose`, `build-skill`) were maintained solely to expose command ergonomics, re-explaining parent axioms and introducing drift.
3. Skills contained verbose procedures (>150 lines), excessive narrative diagrams, and unverified platform assumptions.
4. Universal portable workflows were intermixed with personal, vault-specific tooling (such as Brain ledger loggers and inbox curators).
How do we structure an agent skills system that accelerates building while actively enforcing developer learning, explicit decision ownership, and cross-platform portability?
## Decision Drivers
* **Pedagogical Alignment (The Delegation vs. Learning Boundary)**: The workflow must not optimize solely for output volume. It must force the apprentice engineer to pause, understand failure modes, and reason about architectural trade-offs.
* **Single Authoritative Source**: Every rule and skill must exist in exactly one canonical location with zero manual synchronization drift.
* **Context Load Economics**: Skills must remain concise (target ≤ 50 lines, hard cap 80 lines) to minimize prompt overhead and prevent reasoning dilution.
* **Platform Independence**: Core software engineering skills must adhere to open standards (plain Markdown, standard frontmatter) without being tightly coupled to a single vendor or agent harness.
* **Clear Epistemic Separation**: General software engineering behaviors must remain strictly decoupled from project-specific knowledge graphs or personal vault structures.
## Considered Options
* **Option 1: Monolithic Vault-Coupled Skills (Status Quo)**: Retain skills inside the personal second-brain repository, maintaining mirror copies in the harness configuration directory and wrapper aliases for slash commands.
* **Option 2: Standalone Pure-Automation Skills**: Extract skills into a separate repository optimized strictly for autonomous task completion, allowing the agent to diagnose, edit, and commit code without interactive checkpoints.
* **Option 3: Standalone Portable Skills with Pedagogical Review Gates (Adopted)**: Decouple skills into a dedicated, public domain repository (`skills`). Merge slash-command wrappers into their parent skills, enforce a strict 80-line budget per skill, separate portable engineering skills from environment-specific extensions, and mandate explicit human checkpoints ("Your call") where the agent must offer 2-3 concrete options rather than deciding autonomously.
## Decision Outcome
Chosen option: **Option 3: Standalone Portable Skills with Pedagogical Review Gates**.
This model establishes a deliberate boundary between task delegation and deliberate practice. The AI provides structured investigative discipline and proposal synthesis, but the apprentice engineer retains ownership of every critical design, diagnostic, and commit boundary.
### Core Architectural Commitments
1. **The Delegation vs. Practice Boundary**:
- In `/practice`, the learner writes all repository implementation code and drives analysis; the agent acts strictly as a Socratic tutor using graduated assistance and transfer challenges.
- In `/diagnose`, the agent gathers empirical evidence and eliminates hypotheses, but pauses at a 6-part checkpoint before crossing any state-changing boundary.
- In `/git-commit`, the working tree and diff remain authoritative truth; the agent proposes 2-3 commit slicing options with draft messages, but the human approves every state transition.
- In `/document`, the engineer provides the core insight in their own words before drafting begins, preventing AI hallucination of design rationale.
2. **Single Authority & Wrapper Elimination**:
- Every skill's directory `name` directly defines its invocation command. Redundant alias wrappers are eliminated.
- The standalone repository `~/Projects/active/skills` is the sole source of truth. Runtime agent configurations install skills via `install.sh`.
- The personal Brain vault removes duplicate skill definitions and maintains only an index pointer to the standalone repository.
3. **Shared Epistemic Skeleton & line Budget**:
- All portable skills follow a universal 5-section skeleton: `Use when`, `Steps`, `Your call`, `Done when`, and `Hands off to`.
- Hard budget: `SKILL.md` must remain ≤ 80 lines (achieved ≤ 54 lines across all core skills). Deep schemas and reference authoring templates are progressively disclosed under `references/`.
4. **Hierarchical Separation of Concerns**:
- `skills/`: Universally portable engineering skills (`build-skill`, `diagnose`, `document`, `git-commit`, `practice`).
- `brain/`: Context-specific extensions (`inbox-curation`, `commit-logger`).
- `profile/`: Global developer persona and the universal "Your call" convention (`profile/AGENTS.md`).
## Pros and Cons of the Options
### Option 1: Monolithic Vault-Coupled Skills
* Good: Kept personal notes and agent configurations within a single workspace repository.
* Bad: Caused silent drift between runtime copies and vault specs.
* Bad: Made personal vault paths and private project names leak into portable workflows.
* Bad: Multiplied maintenance burden across redundant wrapper files.
### Option 2: Standalone Pure-Automation Skills
* Good: Minimizes human keystrokes during rapid prototyping.
* Bad: Actively harms the developer's learning path by obscuring underlying mechanisms.
* Bad: Encourages passive acceptance of AI-generated architecture without verification.
* Bad: Violates the apprentice mindset required to transition into professional engineering.
### Option 3: Standalone Portable Skills with Pedagogical Review Gates (Adopted)
* Good: Protects the learning curve by embedding Socratic friction directly into the development loop.
* Good: Achieves 70%+ reduction in skill prompt token overhead.
* Good: Idempotent `install.sh` enables deployment to multiple harnesses (Antigravity, Claude Code, Gemini CLI) from one source.
* Good: Public domain licensing (The Unlicense) allows the toolkit to serve as a clean public portfolio piece.
* Bad: Requires explicit human approval and input at each milestone, sacrificing fully autonomous unattended execution in favor of correctness and learning.
## Consequences
### Positive Consequences
* The engineer must actively articulate hypotheses, verify transfer questions, and select commit boundaries, building foundational engineering instincts.
* Skills are fully decoupled from local paths (`/home/<user>`), enabling seamless portability across Linux systems and tools.
* Symlink verification demonstrated that modern CLI harnesses cleanly resolve directory and file symlinks without copying.
### Negative Consequences & Accepted Trade-offs
* Workflows require active interactive engagement; long multi-step pipelines cannot run fully unattended without human presence.
* When authoring new skills, developers must pass through the `build-skill` design review gate and adhere strictly to the 80-line budget.
## More Information
* **Canonical Repository**: [`kiskaadee/skills`](https://github.com/kiskaadee/skills)
* **Shared Architecture Spec**: [`skills/build-skill/references/skeleton.md`](https://github.com/kiskaadee/skills/blob/main/skills/build-skill/references/skeleton.md)
* **Vault Index Pointer**: [`05-agents/skills/README.md`](../../05-agents/skills/README.md)
@@ -0,0 +1,226 @@
---
type: decision
status: accepted
project: homelab
date: 2026-10-07
tags:
- homelab
- architecture
- decisions
- adr
- appctl
- control-plane
- security
- identity
- provenance
---
# Homelab Operational Control Plane & Deployment Model Architecture
## Context and Problem Statement
The `roadtotech.me` platform historically relied on `appctl` as a local, procedural Bash CLI wrapper (`scripts/appctl`) coupled with a Python metadata engine (`scripts/appctl_engine.py`). Operational commands (`up`, `down`, `restart`, `update`, `logs`, `sync`) executed as ad-hoc subprocesses on the server host, sourcing environment files from `/run/secrets/`.
This model created several architectural tensions:
1. **Coupled Unix Authority**: Executing operational commands required SSH access to the server with Unix user credentials and sudo privileges, conflating platform operations with host administration.
2. **Interface Fragmentation**: The local CLI, the GitOps webhook dispatcher, and dashboard synchronization tools independently implemented or invoked deployment actions, risking divergent operational behavior.
3. **Secret Lifecycle Coupling**: Workload secrets were coupled to the operator's laptop via SOPS and Age keys, requiring encrypted diffs in Git history and full NixOS rebuilds for every secret rotation.
4. **Manual Workload Authoring Friction**: Adding a new application required manually creating directories under `~/Sites`, configuring Docker Compose files, and handwriting Traefik ingress labels and network bindings.
5. **Absence of Unified Auditability**: Operational commands lacked an authenticated, centralized ledger capturing operator identity, client IP, action, target revision, and execution outcome.
How should Homelab Core transition its operational architecture to provide a centralized operational control plane, robust identity boundaries, clean secret distribution, and safe deployment authoring without introducing distributed cloud complexity?
## Decision Drivers
* **Control Plane Centralization**: Exactly one authoritative implementation of every operational action (`deploy`, `restart`, `inspect`, `sync`, `validate`).
* **Identity Decoupling & Least Privilege**: Operating the homelab platform must not require host Unix administrative credentials. Host access does not confer appctl authority.
* **Declarative Git Ground Truth**: Git remains the authoritative source of truth for deployment state, maintaining provenance, rollback capability, and version history.
* **Separation of Intent from Materialization**: Differentiate candidate deployment suggestions (`DeploymentProposal`) from validated, implementation-agnostic intent (`DeploymentModel`), and both from materialized runtime descriptors (`app.yaml`, Compose files).
* **KISS Primitives & Minimal Control Paths**: Avoid distributed message brokers, microservice meshes, or deployment databases. Preserve linear, synchronous, and observable execution.
* **Secret Reference Invariant**: Deployment definitions must contain secret references, never plaintext or encrypted secret material.
* **Client / Control-Plane Boundary**: The control plane owns operational logic; user interfaces (CLI, dashboard, AI authoring) are downstream clients.
## Considered Options
* **Option 1: Status Quo with Modernized Local CLI (appctl-v2)** — Modernize `appctl_engine.py` into a type-safe Python engine while keeping it strictly a local command-line tool executed over SSH.
* **Option 2: Cloud-Native Micro-Platform (Kubernetes / Nomad / ArgoCD)** — Replace `appctl` with enterprise orchestration frameworks and distributed control loops.
* **Option 3: Homelab Operational Control Plane with Stable Deployment Model** — Evolve `appctl` into a centralized, command-oriented control plane daemon exposed via Unix socket and HTTP. Git remains the authoritative deployment ledger. Introduce a formal `DeploymentModel` validated against Core capabilities and invariants.
## Decision Outcome
Chosen option: **Option 3: Homelab Operational Control Plane with Stable Deployment Model**, because it centralizes operational authority, decouples operator identity from Unix credentials, preserves Git as declarative ground truth, and establishes a secure deployment authoring seam while preserving the lightweight, appliance-based foundation of Homelab Core.
---
### Summary of Architectural Commitments
```text
Human Operator / Automation
│
┌───────────────────┴───────────────────┐
│ │
Operations UI CLI (Local & Remote)
│ │
└───────────────────┬───────────────────┘
│
appctl Control Plane API
(One Logical API across Transports)
│
┌────────────┴────────────┐
│ │
Unix Socket HTTP Listener
(Host Clients) (Remote/LAN Clients)
│ │
└────────────┬────────────┘
│
┌───────────────────────────┼───────────────────────────┐
│ │ │
Authentication Deployment Model Operations
& Authorization Plane Execution
│ │ │
Token Validation & ┌──────┴──────┐ Docker Compose
LLDAP Directory RBAC │ │ Traefik Routing
AI Investigation Human Host Secrets
│ Approval Reconciliation
▼ │
DeploymentProposal │
│ ▼
└─────▶ DeploymentModel
│
▼ (Committed to Git)
Deployment Repository
(Git Truth)
│
▼ (appctl validates & materializes)
Deployment Definition
(Sites app.yaml + compose)
│
▼
Runtime Reconciliation
```
#### 1. One Logical Control-Plane API across Dual Transports
* `appctl` transitions from a collection of local shell scripts into the authoritative **operational control plane service** for Homelab Core, managed as a systemd service (`homelab-appctl.service`).
* The control plane exposes **one logical, command-oriented API** (e.g. `POST /operations/deploy`, `POST /operations/restart`, `GET /workloads`, `GET /workloads/{id}/status`, `POST /operations/sync`).
* Transport is decoupled from contract:
* **Unix Domain Socket** (`/run/homelab/appctl.sock`): Used by local host clients (local CLI).
* **HTTP Listener** (Localhost / LAN fronted by Traefik): Used by remote clients (remote CLI, Operations UI, GitOps dispatcher).
* Both local and remote clients invoke the exact same logical API schema.
#### 2. Identity, Authentication & Host Authority Decoupling
* **Host Access Does Not Confer Appctl Authority**: Entering the server via SSH is merely host access; it does not substitute for appctl authentication. **Every mutating appctl operation requires an explicit, authenticated user-scoped token**, regardless of transport.
* **Authentication Modes**:
* *Interactive Web / Operations UI*: Ingress routes via Traefik and Authelia (ForwardAuth). The control plane accepts identity from trusted headers (`Remote-User`, `Remote-Groups`).
* *Remote & Local CLI*: Authenticates via explicit user-scoped API tokens (`Authorization: Bearer <token>`) mapped to an LLDAP user profile.
* *GitOps Dispatcher*: Authenticates via cryptographic HMAC-SHA256 signatures with the webhook shared secret.
* **Role-Based Access Control (RBAC)**: Maps LLDAP groups to permissions (`homelab-admin`, `homelab-operator`, `homelab-viewer`).
* **Telemetry & Append-Only Audit Log**: Every operation records an append-only audit entry distinguishing four orthogonal dimensions:
* `Principal`: Human username (e.g. `fabian`) or service account (`gitops-bot`).
* `Action` & `Target`: The requested operation and workload.
* `Transport`: `unix_socket` vs. `http`.
* `Network Origin`: `local`, `internal_network`, `external_network`.
* `Client`: `local_cli`, `remote_cli`, `web_ui`, `gitops`.
* `Timestamp`, `Duration`, and `Result`.
* Filesystem permissions on `audit.jsonl` are restricted (`0600`), daemon-only writeable, with optional cryptographic hash chaining (`prev_hash`) for tamper evidence.
#### 3. Declarative Git Truth as Authoritative Deployment State
* **Git is the Authoritative Source of Deployment State**:
* When a human operator approves a `DeploymentModel`, that model is committed to the version-controlled deployment catalog (Git).
* `appctl` does not bypass version control. Git maintains immutable revision history, commit provenance, peer reviews, and rollback capability (`git revert`).
* `appctl` serves as the authoritative reconciliation engine: it validates the versioned `DeploymentModel`, compiles/materializes the concrete platform descriptors (`app.yaml` + `docker-compose.yml`), provisions isolated state roots (`~/var/lib/homelab/<app>/`), and reconciles running containers.
#### 4. Five-Stage Deployment Lifecycle (Intent vs. Implementation)
* We separate candidate investigation, validated intent, and implementation artifacts into a clean progression:
$$\text{Repository} \xrightarrow{\text{Investigation}} \text{Application Profile} \xrightarrow{\text{Proposal}} \text{DeploymentProposal} \xrightarrow{\text{Human Selection}} \text{DeploymentModel} \xrightarrow{\text{Git Commit}} \text{Deployment Definition} \xrightarrow{\text{Reconcile}} \text{Runtime Containers}$$
1. **Application Profile**: Factual evidence gathered from repository inspection (detected ports, dependencies, persistence needs).
2. **`DeploymentProposal`**: Candidate architectural options generated by the authoring agent (e.g. Model A Minimal, Model B Persistent, Model C Full Stack).
3. **`DeploymentModel`**: The operator-selected, implementation-agnostic representation of desired intent (ports, domain routing, persistent storage, dependencies, environment references). Free of Docker Compose or Traefik label boilerplate.
4. **Deployment Definition**: Ground-truth platform descriptors (`app.yaml` + `docker-compose.yml`) materialized and enforced by `appctl`.
5. **Runtime Reconciliation**: Deterministic container recreation and health verification.
#### 5. AI Workflow as a Disconnected Authoring Client
* The AI authoring agent is strictly an upstream client with **zero execution or mutation authority**:
* The AI analyzes repositories and drafts `DeploymentProposal` candidates.
* The operator edits, selects, and approves the proposal into a `DeploymentModel`.
* **After human approval, the AI is completely out of the loop.**
* The control plane API exposes standard endpoints (`POST /models/validate`, `POST /operations/deploy`), giving the AI zero special administrative endpoints.
#### 6. Platform Capability Model & Architectural Invariants
Authoring workflows reason against an explicit platform contract:
* **Exposed Capabilities**:
* HTTP edge ingress routing via Traefik (automatic TLS, domain mapping).
* Persistent storage attachments to `/home/kiskaadee/var/lib/homelab/<app>/`.
* Dedicated bridge network attachments (`proxy-net`).
* Deterministic healthchecks (HTTP, TCP, container).
* Resource limits (CPU, memory).
* Secret references resolved at runtime.
* Provenance classes: Class A (Source-Backed) vs. Class B (Image-Only).
* **Non-Negotiable Invariants**:
* Zero privileged containers (`privileged: false`).
* Zero direct Docker socket mounts (`/var/run/docker.sock` restricted to `socket-proxy`).
* Zero arbitrary host mounts (state strictly isolated to dedicated state root).
* Zero arbitrary shell commands or custom lifecycle scripts.
* Zero plaintext secrets in manifests or Compose files.
* Application state isolated from Git deployment descriptors.
* Explicit provenance tracking (`source.url`, `source.ref`, and OCI image digest).
#### 7. Secret Reference & SecretProvider Boundary
* **Architectural Invariant**: Deployment definitions contain **secret references**, never secret material.
* `appctl` defines a clean `SecretProvider` interface. At deployment reconciliation time, `appctl` resolves references through the provider and projects secrets into the workload runtime.
* **Domain Segregation**:
* Host platform secrets remain declaratively managed via `sops-nix` in `nixos/secrets.yaml`.
* Workload application secrets are referenced by key and resolved dynamically, eliminating Git history pollution and laptop-key coupling without turning `appctl` into an ad-hoc cryptographic vault.
#### 8. Client Decoupling & UI Boundary
* `appctl` owns the control-plane contract, not its clients.
* **Homepage**: Remains the read-only service portal and status aggregator, consuming status data from `appctl`. It does not become an interactive deployment console.
* **Operations UI**: A dedicated, lightweight web client for interactive approvals, token generation, and log viewing, deployed as a client of the `appctl` API.
* **CLI (Local & Remote)**: Command-line clients consuming the `appctl` API.
---
## Pros and Cons of the Options
### Option 1: Status Quo with Local CLI Modernization
* Good: Requires no new daemons or networking listeners.
* Bad: Perpetuates host SSH credential sharing for basic operations.
* Bad: Provides no programmatic API for web dashboards or AI workflows.
* Bad: Remote management requires interactive SSH terminal access.
### Option 2: Cloud-Native Micro-Platform
* Good: Kubernetes/ArgoCD natively provide declarative control planes, RBAC, and APIs.
* Bad: Resource overhead and operational complexity are disproportionate for a single-node homelab appliance.
* Bad: Violates the KISS principle and introduces complex distributed failure modes.
### Option 3: Homelab Operational Control Plane with Stable Deployment Model (Adopted)
* Good: Unifies all operations behind a single authoritative implementation.
* Good: Enforces directory-backed RBAC and produces a verifiable audit trail without exposing host Unix credentials.
* Good: Preserves Git as declarative ground truth for deployment state.
* Good: Introduces a clean authoring boundary (`DeploymentProposal` $\to$ `DeploymentModel`) that makes AI-assisted deployments safe and reviewable.
* Good: Decouples secret management from Git history pollution.
* Bad: Requires running and monitoring an additional Core systemd daemon (`homelab-appctl.service`).
* Bad: Requires managing API tokens for remote and local CLI clients.
---
## Consequences
### Positive Consequences
* **Principle of Least Privilege**: Routine operations (deploying apps, viewing logs, restarting services) no longer require host root/sudo SSH access.
* **Single Operational Truth**: Local CLI, remote CLI, GitOps, and web clients invoke identical control-plane logic.
* **Declarative Reproducibility**: Deployments remain 100% reproducible and auditable through version-controlled Git history.
* **Safe AI Authoring**: AI agents can inspect repositories and generate rich proposals, but can never directly mutate the host.
* **Clean Auditability**: Every operational state change is attributable to a specific identity and recorded with transport and origin telemetry.
### Negative Consequences & Accepted Trade-offs
* **Daemon Availability Dependency**: Operations depend on the health of the `homelab-appctl` service. (Emergency fallback: direct Docker Compose commands remain available to host administrators via SSH).
* **Explicit Token Discipline**: Host execution over SSH requires an explicit token rather than inheriting shell user privileges.
---
## More Information
* **Companion Architecture Decision**: [`homelab-3tier-architecture-and-provenance.md`](homelab-3tier-architecture-and-provenance.md)
* **Governed Implementation Roadmap**: [`01-plans/homelab/consolidation/architecture-consolidation-roadmap-v5.md`](../../01-plans/homelab/consolidation/architecture-consolidation-roadmap-v5.md)
* **Project Hub**: [`06-projects/homelab/README.md`](../../06-projects/homelab/README.md)
+122
View File
@@ -0,0 +1,122 @@
---
type: journal
project: brain
date: 2026-10-05
tags:
- skills
- brain
- agent-architecture
- learning-theory
- unlicense
- bdinvite
- graphify
- benchmark
assessed_commits:
- 42927b9858c1b091bb6e78d3abcf6f9500bd7547
- 364601af3dede7f247a81a9e6760879f7eb6bd42
- e1f745608a9a00a27baaa014b2d631f91adcbecd
- cd4b52cdce7c681f82ca237e18fa2601b2fb2e6e
- d01eef586166cc175ca44096b94cf079369d20dd
- a05e98a94c6f45ad2103b2142fe5d372cfed2285
- fee7429a1064193c066b8c20bd6927977599a67f
- 9ae6c84a066dceda7ccc520833fcc78dd6fef8ec
- 70bdc0e5dc6c0a2a8ffa088847f4bab0eeb03828
- 6b529cf86a12f6bcd3d7eb41ef40444c58f68236
- 552ebe48b4ee1a5621ee5a728aee4c40f00ed298
- 98635f73ada6003babd358234af18865f19fc21f
- ae38ba6414ecda9e919e244b7f3db8762ee6135b
- 8fafa08d13711796154d5a6005997c644373792b
- cf14d806d363f857e142210b73253af6bea92bd4
- 6281a266654856bd9446aed1df1aaddf5717ac76
- f72138f7186dce5dad170027d23a4e24e0c3f860
- 5826a10fa20c6aafb441eecb1c3ce6b8693e4431
- de43014c0c765194feffe776e6bf34b3ede21797
- 4bc004da6d599e334753045957daecc82f398386
- 6d1af69a54a1766d049b68d057e32b6fd31a6b7f
- 06ee05cf46cb8d6d0912ddb438b5b527c00c44dc
---
# Daily Journal: 2026-10-05
## Wins
### Skills Repository Decoupling & Architecture
- **Portable Core vs. Vault Extensions**: Formally separated universal pair-programming skills (`skills/`) from context-dependent workflows (`extensions/`). Codified the repository invariant: *Portable skills must not encode a user's filesystem topology*.
- **Semantic Path Abstraction**: Standardized skills (`document`, `practice`) to express destinations semantically (e.g. `default notes inbox`, `project docs/`), delegating concrete path mapping to the active agent profile rather than brittle runtime `.config` lookups.
- **Learner-First Philosophy**: Authored the *"Why Build Instead of Borrow?"* rationale in `README.md`, articulating four core design principles: defeating the Comprehension Illusion, intentional epistemic friction ("Your call"), operational ownership, and radical simplicity over prompt bloat.
- **Unlicense Adoption**: Dedicated the skills repository to the public domain under `UNLICENSE.md` with zero proprietary constraints.
- **Journal Builder Protocol**: Specified, implemented, and verified [`skills/journal-builder/SKILL.md`](https://github.com/kiskaadee/skills/blob/main/skills/journal-builder/SKILL.md). Structured as a daily engineering-learning synthesis pipeline featuring locked learning objectives, hidden assessment rubrics, 3-part formative feedback, and an explicit `Answer:` vs. `Skip:` response contract.
- **Journal Specification in Document**: Expanded `document` to include `Journal` as a 6th epistemic type, codifying the canonical format in `skills/document/references/journal-authoring.md`.
- **Commit Logger Pipeline Restoration**: Activated `commit-logger` in `install.sh`, fixed parent-SHA resolution on initial commits, and backfilled all 12 repository commits into `Brain/00-inbox/commit-log.csv`.
- **Pipeline Contracts & Boundary Alignment**: Resolved inter-skill contracts: defined the explicit provenance boundary for incremental `journal-builder` runs, aligned `journal-authoring` mutability to support reconciliation, and bounded `draft-curation` to hand off to `git-commit` rather than mutating history directly.
### Second Brain Knowledge Graph
- Synchronized vault index nodes ([`05-agents/skills/README.md`](../../05-agents/skills/README.md) and [`AGENTS.md`](../../AGENTS.md)) to reference `extensions/draft-curation` and `extensions/commit-logger`, passing all repository structural and typing validations.
### BDInvite Graphify Benchmark Review
- Reviewed the eight-checkpoint A/B benchmark comparing standard repository exploration with Graphify-assisted exploration. Both conditions passed the benchmark gates; Graphify used fewer estimated tokens in five checkpoints, while its aggregate was 22.92 million versus 19.91 million for control (+15.1%).
- Revisited how checkpoint-level results support conclusions about Graphify and identified limits in the experiment's causal attribution.
---
## Decisions, Incidents & Artifacts
- [Skills Repository](https://github.com/kiskaadee/skills)
- `f72138f`: `docs: clarify philosophy, license, and repository invariants`
- `5826a10`: `refactor: separate portable core skills from vault extensions`
- `de43014`: `feat(journal-builder): add journal-builder skill and document authoring spec`
- `4bc004d`: `feat(extensions): update draft-curation with journal reconciliation and fix commit-logger parent-sha`
- Brain Repository:
- `3cde2c4`: `agent(skills): update extension pointers to draft-curation`
- [Journal Authoring Specification](https://github.com/kiskaadee/skills/blob/main/skills/document/references/journal-authoring.md)
- Standardized the multi-project daily journal structure (`Wins`, `Artifacts`, `Mistakes & Learning Edges`, `Reflections`).
- BDInvite Graphify Benchmark:
- [SSO benchmark roadmap](../../01-plans/bdinvite/sso-benchmark-roadmap.md)
- [Graphify experiment retrospective](../../02-discussions/bdinvite/graphify-agent-experiment-retrospective.md)
---
## Mistakes, Gaps & Learning Edges
### Skills & Agent Architecture
- **Objective 1 (Semantic Destination Mapping)**:
- *Status*: **Achieved** (first attempt)
- *Demonstrated*: Articulated that portable skills must express destinations semantically ("configured notes inbox"), leaving concrete filesystem resolution to the active agent profile.
- **Objective 2 (Configuration Failure Domains)**:
- *Status*: **Achieved** (after formative follow-up)
- *Initial gap*: Captured runtime tool-call costs, but initially omitted the architectural failure modes.
- *Demonstrated*: Reconstructed that centralizing paths in the profile creates a single source of truth and enforces separation of concerns—freeing skills from duplicated environment-discovery machinery so they can focus on their single responsibility.
- **Objective 3 (Memory Pipeline & The Closed Loop)**:
- *Status*: **Achieved** (after formative follow-up)
- *Initial gap*: Described `journal-builder` passively as assessing whether reasoning is "clear".
- *Demonstrated*: Reconstructed the active pedagogical role of the closed assessment loop: locking objectives beforehand from historical evidence prevents shifting goalposts, while hidden rubrics force concrete demonstration and enable systematic reinforcement of conceptual gaps.
- **Dogfood Discoveries Codified into Invariants**:
- *Atomic Objective Invariant*: Compound objectives create ambiguous grading; objectives must test a single, independently assessable understanding.
- *Formative Feedback Rule*: The agent must provide 3-part feedback (correct, missing, decision) after every answer and never grade on a curve.
- *Strict Pipeline Separation*: `journal-builder` outputs content and hands off to `document` without offering or managing storage destinations.
### BDInvite Graphify Benchmark
- **Objective 1 (Aggregate Token Interpretation)**:
- *Status*: **Achieved**
- *Demonstrated*: A count of checkpoint wins hides the magnitude of each difference. Large overruns in CP4 and CP7 outweighed the smaller savings across Graphify's five wins.
- **Objective 2 (Causal Limits)**:
- *Status*: **Achieved**
- *Demonstrated*: The results describe these runs but do not establish a general causal effect from Graphify. The implementations diverged, graph queries were sparse, and other agent behavior could explain token differences.
---
## Technical & Personal Reflections
- **Piercing the Comprehension Illusion in Agent Tooling**:
- The temptation with AI assistance is to optimize for smooth task completion—generating code, summarizing commits, and praising plausible answers. This dogfood run demonstrated that true pairing requires epistemic friction. When the agent stopped grading on a curve and challenged partial answers, it transformed the session from passive activity logging into genuine conceptual consolidation.
- **The Value of the Closed Assessment Loop**:
- Having the agent lock a hidden rubric before asking questions fundamentally changes the dynamic. It prevents the model from rationalizing a vague answer, and gives the learner an immediate, concrete target for reflection when a knowledge gap is surfaced.
- **Checkpoint Counts Hide Cost Magnitude**:
- Graphify's five checkpoint wins did not predict its aggregate token usage because the overruns in CP4 and CP7 were much larger than the savings elsewhere. The observed totals also cannot isolate Graphify's effect when implementation paths differ and graph usage is limited.
---
## Next Objectives
- Dogfood the full pipeline (`git-commit` $\to$ `commit-logger` $\to$ `journal-builder` $\to$ `document` $\to$ `draft-curation`) during upcoming feature and infrastructure work in `bdinvite` and `homelab`.
- Design a follow-up Graphify benchmark that constrains implementation variance and records provider-reported token and cache usage.