my-homelab-configs/docs/code-map.md

6.8 KiB

Repository Code Map

Refreshed with graphify update . on December 2, 2026, from checkout HEAD ead716b, including the existing tracked working-tree edits. The graph has 3,627 nodes, 7,304 edges and 287 communities. The generated local map is graphify-out/graph.json, with graph.html and GRAPH_REPORT.md alongside it. That directory is intentionally gitignored; this guide records the useful paths without committing generated caches.

Graphify is a navigation aid. The paths below were checked against source; dynamic imports and shell dispatch are not a complete call graph. The refresh reported three extracted nodes without source_file metadata and 66 skipped unclassified files. It renamed 38 communities using their hubs; names were not refreshed with an LLM. Graphify's code refresh does not replace semantic extraction for documents or images; verify their contents against the source.

Responsibility Entry point Relationship to the pipeline
CLI and API jeannie, API server API allowlisted commands use the same CLI; internal tasks and recursive remote dispatch stay excluded.
Status and doctor status-focus, doctor-focus, report-ui Inventory-scoped status collects host, Compose and Argo snapshots; doctor adds item evidence and optional validated AI explanations.
Runner diagnosis doctor-runner-report, runner deployment The optional Kubernetes runner is scaled to zero; the default CI runner is a Debian systemd service. A start is proposed only for an installed inactive host service.
Profile inventory env.sh, homelab.yml One shared loader exports profile defaults and Terraform variables; pipeline sources it.
Runtime exclusion cluster-runtime-guard.py Host services, private K3s workloads, API listeners and VM states gate deployment/start; a shared lock serializes pipelines.
Identity and state cluster-context.py Endpoint, CA and namespace UID bind each profile; guarded tools use separate scoped backends.
Runtime bootstrap cluster/main.tf Selects kubeadm or native K3s; the native remote bootstrap explicitly executes Bash and requires the declared hypervisor capability.
Scheduling estimate scheduling-preflight.py Estimate, pod_requests and manifests_from_plan connect planned workloads to live capacity, placement and rollout constraints.
Application storage registry-storage-reconcile.py prepare_local, publish_remote and remote_manifest stage, verify and preserve registry data before placement changes.
Native transition cluster-transition.py, k3s-stop.sh A private phase journal sequences retirement, offline storage copy, bootstrap, independent identity enrollment, platform and apps.
Layer orchestration pipeline.sh Applies guards, discovery/adoption, bounded transport retries and readiness checks around OpenTofu and Argo operations.
Documentation render-docs, templates README and modular guides are generated from templates; the service catalog comes from inventory.
Blog blog.php, diagram model, generator, English copy A curated model and inventory generate the public SVG; language dictionaries supply narrative copy.
Network sandbox network-sandbox.md, lifecycle, runtime guard OpenWrt and Alpine guests use their own bridge; lifecycle and isolation exercises are independent of the selected Kubernetes profile.
AI experiments AI lab, ai-lab-suite.py, goose-graph.py Compare local inference engines separately from production routes; use the generated graph as bounded context for repository learning.
Holmes remediation doctor-focus, local proxy, tool adapter Doctor dispatches Holmes investigations; the local repair path requests a 16,384-token Ollama context, adapts tool calls, and independently checks application health. Tool use does not prove a successful repair.
Kubernetes learning labs OpenTelemetry, Gateway API, secrets, progressive delivery Opt-in labs exercise tracing, routing, secret/certificate lifecycle and rollout failure handling.

Native transition flow

flowchart TD
    A[Review transition plan] --> B[Verify pinned laptop identity]
    B --> C[Stop laptop K3s workloads and archive state]
    C --> D[Stop VMs and copy verified registry offline]
    D --> E[Bootstrap K3s on Orange Pi]
    E --> F[Compare API identity with direct SSH reads]
    F --> G[Enroll new profile identity]
    G --> H[Scheduling estimate and platform apply]
    H --> I[Registry placement and app delivery]

Failures retain the journal and original data. Resume the same transition command after fixing the cause. Only registry data is copied; other old laptop PVC data requires a separate restore. A Ready node proves bootstrap readiness, not completion of every platform or application rollout.

Documentation maintenance

See AI tooling assessment for the December 2026 review of Headroom, CodeBurn and PonyTail against these integration points.

Edit README.md.tmpl and docs/templates/*.md.tmpl, then run scripts/render-docs. Keep architecture, deployment, app operations and AI operations in their own guides; duplicated copies previously left contradictory instructions in the generated documentation. Review the public diagram model when architecture relationships change. CI checks that it can be generated, and Jeannie generates the diagram in a temporary website build context. Website source changes take effect after the normal image build and Argo delivery path; editing PHP does not publish the live site.

Useful local navigation commands:

graphify update .
graphify explain 'cluster-transition.py'
graphify explain 'publish_remote'
graphify query 'scheduling-preflight' --budget 1200