diff --git a/README.md b/README.md index c254e0a..a55ff22 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ Jeannie manages three mutually exclusive Kubernetes profiles, keeps recovery and build services on the Debian laptop, and delivers apps through Argo CD. -The current migration target is native K3s on the Orange Pi 5 Plus; the hybrid -and all-Pimox kubeadm profiles remain available. +The K3s profile runs natively on the Orange Pi 5 Plus; the hybrid and +all-Pimox kubeadm profiles remain available. ## Quick Start @@ -34,7 +34,7 @@ instead. Do not start a second deployment while that transition is running. | `pimox` | Pimox VM 9001 at `.65`, kubeadm | Pimox VMs 9010/9011 | `pimox-config` | | `k3s` | Orange Pi host `.80`, native K3s | Same host | `opi5-k3s-config` | -Native K3s requires all Pimox VMs stopped. The VM profiles require host K3s +Native K3s requires the declared Kubernetes-profile Pimox VMs stopped. The VM profiles require host K3s stopped; `debian` also requires VM 9001 stopped, and `pimox` requires the laptop control plane stopped. Pipelines refuse conflicting or unverifiable runtimes. The inventory still defaults to `pimox`; explicit selection prevents surprises. @@ -47,6 +47,8 @@ The detailed technical specifications have been moved to the `/docs` directory: - [Deployment Guide](docs/deployment.md) - Prerequisites, bootstrap flow, and validation. - [AI Operations](docs/ai-ops.md) - Jeannie AI tools, Evals, and Safety cases. - [Application Ops](docs/app-ops.md) - App delivery, Gitea, and Website management. +- [Status overview](docs/status-overview.md) and [focused doctor](docs/doctor-overview.md) - Fast checks and item-level diagnosis. +- [Network sandbox](docs/network-sandbox.md) and [AI lab](docs/ai-lab.md) - Independent learning environments. - [Service Catalog](docs/service-catalog.md) - Declared inventory of hosts and services. - [Repository Code Map](docs/code-map.md) - Graphify findings and the code behind deployment guards. @@ -92,8 +94,8 @@ gateway and host-level tools: OmniRoute endpoint, and validated model routes. - `./jeannie doctor-k8s` performs read-only Kubernetes collection and can ask Holmes for triage through OmniRoute. Ollama remains useful for small - local tasks, but agentic Kubernetes triage is routed through OmniRoute-backed - cloud/free providers. + local tasks; the configured OmniRoute route determines whether agentic + triage uses a local or external provider. Run `./jeannie up` and `./jeannie nuke` only from the Debian homelab server. @@ -101,3 +103,9 @@ Run `./jeannie up` and `./jeannie nuke` only from the Debian homelab server. The [neural network from scratch lab](labs/neural-network-from-scratch/README.md) walks through a NumPy classifier, backpropagation, and a training-loss plot. +The opt-in Kubernetes labs cover [OpenTelemetry and Tempo](apps/opentelemetry-lab/README.md), +[Gateway API and FastAPI](apps/gateway-lab/README.md), +[secrets and certificates](apps/secrets-lab/README.md), and +[progressive delivery](apps/progressive-lab/README.md). The independent +[network sandbox](docs/network-sandbox.md) and [AI lab](docs/ai-lab.md) +provide isolated experiments outside the cluster rollout. diff --git a/README.md.tmpl b/README.md.tmpl index 9264f24..7ac256e 100644 --- a/README.md.tmpl +++ b/README.md.tmpl @@ -4,8 +4,8 @@ Jeannie manages three mutually exclusive Kubernetes profiles, keeps recovery and build services on the Debian laptop, and delivers apps through Argo CD. -The current migration target is native K3s on the Orange Pi 5 Plus; the hybrid -and all-Pimox kubeadm profiles remain available. +The K3s profile runs natively on the Orange Pi 5 Plus; the hybrid and +all-Pimox kubeadm profiles remain available. ## Quick Start @@ -34,7 +34,7 @@ instead. Do not start a second deployment while that transition is running. | `pimox` | Pimox VM 9001 at `.65`, kubeadm | Pimox VMs 9010/9011 | `pimox-config` | | `k3s` | Orange Pi host `.80`, native K3s | Same host | `opi5-k3s-config` | -Native K3s requires all Pimox VMs stopped. The VM profiles require host K3s +Native K3s requires the declared Kubernetes-profile Pimox VMs stopped. The VM profiles require host K3s stopped; `debian` also requires VM 9001 stopped, and `pimox` requires the laptop control plane stopped. Pipelines refuse conflicting or unverifiable runtimes. The inventory still defaults to `pimox`; explicit selection prevents surprises. @@ -47,6 +47,8 @@ The detailed technical specifications have been moved to the `/docs` directory: - [Deployment Guide](docs/deployment.md) - Prerequisites, bootstrap flow, and validation. - [AI Operations](docs/ai-ops.md) - Jeannie AI tools, Evals, and Safety cases. - [Application Ops](docs/app-ops.md) - App delivery, Gitea, and Website management. +- [Status overview](docs/status-overview.md) and [focused doctor](docs/doctor-overview.md) - Fast checks and item-level diagnosis. +- [Network sandbox](docs/network-sandbox.md) and [AI lab](docs/ai-lab.md) - Independent learning environments. - [Service Catalog](docs/service-catalog.md) - Declared inventory of hosts and services. - [Repository Code Map](docs/code-map.md) - Graphify findings and the code behind deployment guards. @@ -92,8 +94,8 @@ gateway and host-level tools: OmniRoute endpoint, and validated model routes. - `./{{ main_script }} doctor-k8s` performs read-only Kubernetes collection and can ask Holmes for triage through OmniRoute. Ollama remains useful for small - local tasks, but agentic Kubernetes triage is routed through OmniRoute-backed - cloud/free providers. + local tasks; the configured OmniRoute route determines whether agentic + triage uses a local or external provider. Run `./{{ main_script }} up` and `./{{ main_script }} nuke` only from the Debian homelab server. @@ -101,3 +103,9 @@ Run `./{{ main_script }} up` and `./{{ main_script }} nuke` only from the Debian The [neural network from scratch lab](labs/neural-network-from-scratch/README.md) walks through a NumPy classifier, backpropagation, and a training-loss plot. +The opt-in Kubernetes labs cover [OpenTelemetry and Tempo](apps/opentelemetry-lab/README.md), +[Gateway API and FastAPI](apps/gateway-lab/README.md), +[secrets and certificates](apps/secrets-lab/README.md), and +[progressive delivery](apps/progressive-lab/README.md). The independent +[network sandbox](docs/network-sandbox.md) and [AI lab](docs/ai-lab.md) +provide isolated experiments outside the cluster rollout. diff --git a/docs/ai-ops.md b/docs/ai-ops.md index 28f5d64..b5df0cd 100644 --- a/docs/ai-ops.md +++ b/docs/ai-ops.md @@ -31,9 +31,9 @@ The split is: `jeannie-hermes`) plus `/data/homelab-ai-stack/ai-tools.env`. - `ai-check` verifies the knowledge index, wrappers, OmniRoute endpoint, and validated model route hints before Jeannie relies on them. -- Ollama remains on Debian for single-purpose local tasks such as translation - cache misses, but Holmes agentic Kubernetes triage should use the - OmniRoute-backed routes. +- Ollama remains on Debian for local inference. OmniRoute can route to local + or external providers; choose routes based on the task, privacy and measured + performance rather than assuming a particular provider is fastest. Bootstrap and validation from the Debian server: @@ -70,6 +70,15 @@ approvals and proposals. Depending on the OmniRoute route, the question, graph excerpt and source Goose reads may be sent to an external provider. Token savings depend on the model and task; the byte cap is not an exact token count. +## AI inference lab + +The optional [AI lab](ai-lab.md) installs pinned llama.cpp and Colibri builds +separately from production routes. `./jeannie ai-lab devices` reports +available devices, and `./jeannie ai-lab suite` repeats a set of +prompts across available backends. Compare response quality and timing along +with logs confirming actual device placement; the suite does not select a +winner or automatically change model routes. + ## Holmes-Assisted Kubernetes Doctor `doctor-k8s` is the first integration point between deterministic Jeannie @@ -85,7 +94,7 @@ for triage through the OmniRoute route selected in `models.env`. The evidence bundle identifies the selected profile, runtime, and control-plane node. Failed reads are marked unknown. Holmes must return JSON with cited check IDs; Jeannie renders facts from the evidence and validates citations and any -next command using the same rules as compact status explanations. An invalid +next command using the same rules as focused doctor explanations. An invalid response is rejected and the deterministic artifacts remain available. The private artifact directory holds the evidence, validated explanation, raw model response, and error log. Schema validation cannot prove a hypothesis correct. diff --git a/docs/app-ops.md b/docs/app-ops.md index ed8a904..73c0b77 100644 --- a/docs/app-ops.md +++ b/docs/app-ops.md @@ -2,15 +2,17 @@ ## Current status and recent events -`./jeannie status` defaults to fast mode: it checks current host, cluster, -workload, DNS, registry, and public-route health without log scans, OCI backup -freshness, or an AI response. `./jeannie status --deep` adds those checks, -restart history, and inventory/storage checks. Add `--ai` to request an -unverified AI hypothesis for status or a doctor. `--no-local-rca` disables it; -`--verbose` implies deep mode. The -report identifies its mode, and fast mode cannot establish backup freshness or -the absence of recent errors. Healing collects deep evidence and rejects an -explicitly supplied fast status report. +`./jeannie status` provides a fast overview of Debian, the Orange Pi, RPi, +OCI edge, and the selected cluster. Choose an area with `status debian|opi5|rpi|oci|cluster`. +Text output shows OK or FAILED; warnings display as FAILED and skipped checks +are omitted. `status SCOPE --json` preserves underlying warning and skip +states. Use `./jeannie doctor SCOPE` or `doctor ITEM` for evidence and +diagnosis. See [status](status-overview.md) and [doctor](doctor-overview.md). + +The legacy unscoped `status --deep` and `status --json` use the diagnostic +cascade. Healing collects deep evidence and rejects an explicitly supplied +fast status report. Fast checks do not establish backup freshness or rule out +recent errors. After a planner-driven heal, Jeannie verifies the original finding with a focused live check: the affected Gitea endpoint/container, RPi DNS or service, @@ -19,8 +21,8 @@ verification rechecks the pinned identity. An unknown action is not declared healed; failed checks retry up to `LAB_HEAL_VERIFY_TIMEOUT_SECONDS` (default 180 seconds), with the configured verification interval. -Compact `status` and `doctor-homelab` run independent read-only probes in -parallel (four at a time by default, capped at eight). Set +Focused `status` and `doctor-homelab` run independent read-only probes in +parallel (focused status defaults to eight; report helpers cap at eight). Set `LAB_REPORT_PARALLELISM=1` to serialize them or `LAB_REPORT_TIMING=true` to print probe elapsed time. Identical selected HTTP/container probes reuse results only within that report. HTTP checks for the same URL also share one response @@ -31,12 +33,12 @@ per resource type as needed; snapshots are point-in-time, may differ across resource types, and are discarded when the report ends. API readiness, logs, identity checks, and healing verification continue to query live services. -Status examines Gitea and Traefik logs from the last five minutes by default; +Deep status diagnostics examine Gitea and Traefik logs from the last five minutes by default; `LAB_STATUS_LOG_SINCE` overrides the interval. A few Gitea client disconnects are informational only when its container, local HTTP, and public HTTP checks pass. Other log errors, repeated disconnects, or failed checks remain warnings and point to `doctor-gitea`. Information alone does not select a heal action. -With `--ai`, compact reports send structured findings to the selected model. +With `--ai`, supported doctor reports send structured findings to the selected model. Observed facts come from report rows. Hypotheses must cite existing check IDs; the next command must be an exact read-only command from the report and the allowlist. Invalid responses are rejected. Validation cannot prove a hypothesis @@ -544,18 +546,19 @@ binds the API to the configured LAN listener, and pulls the lightweight ./jeannie ollama-setup ``` -Compact status and doctor reports can request a validated explanation with -`--ai`. Verbose doctors skip the older unstructured backstage helper. The +Focused doctor reports can request a validated explanation with `--ai`. +Selected-item diagnosis enables it by default except for the deterministic +Gitea runner report; `--no-local-rca` disables it. The configured lightweight Ollama model is: ```bash ollama pull qwen2.5:0.5b ``` -For a deterministic report without a model, omit `--ai`: +For a deterministic report without a model: ```bash -./jeannie doctor-edge +./jeannie doctor debian --no-local-rca ``` Build the local homelab knowledge index separately from the main deployment: diff --git a/docs/architecture.md b/docs/architecture.md index e7f0869..734a7a3 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -137,6 +137,12 @@ workload processes and Pimox VM power state. Deployment/start pipelines hold a shared lock and refuse conflicts. This does not prevent manual starts outside Jeannie. Switching modes requires stopping the previous runtime first. +The [network sandbox](network-sandbox.md) is separate from these cluster +profiles. Its OpenWrt VM and Alpine containers use a dedicated VLAN-aware +bridge, and their lifecycle does not gate K3s. WAN tests connect the sandbox +temporarily behind a host guard and disconnect it afterwards; selected probes +do not establish universal isolation. + `cluster-context.py` binds each profile to its API endpoint, CA fingerprint and `kube-system` UID. Its state root is `~/.local/share/homelab/clusters//`, with `identity.json` and separate diff --git a/docs/code-map.md b/docs/code-map.md index 63a6ac5..8a77eff 100644 --- a/docs/code-map.md +++ b/docs/code-map.md @@ -1,18 +1,23 @@ # Repository Code Map -Refreshed with `graphify update .` on November 2, 2026. The generated local map +Refreshed with `graphify update .` on November 11, 2026, from commit +`acaf54b`. The graph has 3,437 nodes, 6,938 edges and 275 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 community -names were derived from hubs rather than refreshed with an LLM. +reported three extracted nodes without `source_file` metadata and 66 skipped +unclassified files. Community names were derived from hubs rather than +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](../jeannie), [API server](../cmd/jeannie-server/main.go) | API allowlisted commands use the same CLI; internal tasks and recursive remote dispatch stay excluded. | +| Status and doctor | [status-focus](../scripts/status-focus), [doctor-focus](../scripts/doctor-focus), [report-ui](../scripts/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](../scripts/doctor-runner-report), [runner deployment](../apps/gitea-runner/deployment.yaml) | 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](../lib/jeannie/env.sh), [homelab.yml](../homelab.yml) | One shared loader exports profile defaults and Terraform variables; pipeline sources it. | | Runtime exclusion | [cluster-runtime-guard.py](../scripts/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](../scripts/cluster-context.py) | Endpoint, CA and namespace UID bind each profile; guarded tools use separate scoped backends. | @@ -23,6 +28,9 @@ names were derived from hubs rather than refreshed with an LLM. | Layer orchestration | [pipeline.sh](../lib/jeannie/pipeline.sh) | Applies guards, discovery/adoption, bounded transport retries and readiness checks around OpenTofu and Argo operations. | | Documentation | [render-docs](../scripts/render-docs), [templates](templates/) | README and modular guides are generated from templates; the service catalog comes from inventory. | | Blog | [blog.php](../apps/website/blog.php), [diagram model](../apps/website/architecture/model.json), [generator](../scripts/render-website-architecture.py), [English copy](../apps/website/lang/en.php) | A curated model and inventory generate the public SVG; language dictionaries supply narrative copy. | +| Network sandbox | [network-sandbox.md](network-sandbox.md), [lifecycle](../scripts/network-sandbox-lifecycle.py), [runtime guard](../scripts/cluster-runtime-guard.py) | 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.md), [ai-lab-suite.py](../scripts/ai-lab-suite.py), [goose-graph.py](../scripts/goose-graph.py) | Compare local inference engines separately from production routes; use the generated graph as bounded context for repository learning. | +| Kubernetes learning labs | [OpenTelemetry](../apps/opentelemetry-lab/README.md), [Gateway API](../apps/gateway-lab/README.md), [secrets](../apps/secrets-lab/README.md), [progressive delivery](../apps/progressive-lab/README.md) | Opt-in labs exercise tracing, routing, secret/certificate lifecycle and rollout failure handling. | ## Native transition flow diff --git a/docs/deployment.md b/docs/deployment.md index 91f98f4..9e620f8 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -371,13 +371,13 @@ Run a read-only health snapshot from the Debian server with: and bootstrap through cluster lifecycle, reports, observability, recovery, access, apps, security, AI, and destructive commands. -`status` uses the reusable report UI and defaults to showing only failures and -warnings so the terminal stays readable. Use `./jeannie status --all` -to show every check, `--details` for row details, `--json` for structured -output, or `--verbose` for the older full host/Docker/Kubernetes/Pimox/RPi/ -Tailscale/HTTP dump. The cascade includes "what broke" signals such as -deployment readiness, pod restarts, node pressure, disk pressure, Traefik -5xx/404 log evidence, and recent Gitea errors. +`status` defaults to a fast overview of all inventory areas. Text output +shows OK or FAILED for each applicable check; warnings are displayed as FAILED +and skipped checks are omitted. Select a single area with `status debian`, +`status opi5`, `status rpi`, `status oci`, or `status cluster`. +Use `--json` after the area for structured output. The legacy unscoped +`status --deep` uses the broader diagnostic cascade. See the +[status guide](status-overview.md) for coverage and limitations. High-signal Prometheus alerts live in `apps/homelab-alerts`. They cover node readiness, pod restart storms, unavailable deployments, node/PVC storage @@ -517,9 +517,23 @@ dirty file count, and command details. entry, GitOps automation, cluster foundation, DNS, observability, and security learning paths. `./jeannie map --dot` emits Graphviz DOT. -Focused doctor commands run narrower read-only checks. They use the same -problems-first UI as `status`; add `--all`, `--details`, `--json`, or -`--verbose` when you need more context: +Focused doctors investigate one inventory area or item and show the collected +evidence. Select an area or item; there is no all-area mode: + +```bash +./jeannie doctor rpi +./jeannie doctor gitea-runner +./jeannie doctor debian homelab-gitea/gitea --details +./jeannie doctor cluster --json +./jeannie doctor rpi --ai +``` + +Item AI explanations use validated citations and can be disabled with +`--no-local-rca`; validation does not prove a hypothesis correct. The Gitea +runner has a deterministic report and can propose starting its inactive Debian +service, with interactive approval required. Other reports do not invent a fix +when the evidence is insufficient. See the [doctor guide](doctor-overview.md). +The earlier specialized doctors remain available: ```bash ./jeannie doctor-edge diff --git a/docs/jeannie-remote-api.md b/docs/jeannie-remote-api.md index e8b2bd7..063efea 100644 --- a/docs/jeannie-remote-api.md +++ b/docs/jeannie-remote-api.md @@ -20,6 +20,16 @@ From a client with network access: JEANNIE_REMOTE_TOKEN='replace-with-a-secret' ./jeannie remote status +Scoped status and doctor commands are available through the same API: + + ./jeannie remote status cluster + ./jeannie remote doctor rpi + ./jeannie remote doctor gitea-runner --details + +The remote process is noninteractive. If a doctor identifies a supported +mitigation, it prints the proposed command for review instead of waiting for +interactive approval or applying it through the report. + `GET /v1/commands` returns the complete remotely enabled command list. Internal `__up-task` and recursive `remote` dispatch are excluded. This API therefore has the same authority as the bearer token and should remain private; commands diff --git a/docs/jeannie.1.md b/docs/jeannie.1.md index 1b0d7a5..e1970bb 100644 --- a/docs/jeannie.1.md +++ b/docs/jeannie.1.md @@ -54,14 +54,12 @@ cluster state. `start-cluster` : Start the Kubernetes control-plane runtime and desired worker VMs. -`status` -: Print a problems-first cascade health report for the configured homelab, from -bootstrap readiness through public website health. By default it only shows -failures and warnings. Use `status --all` for every check, `status --details` -for row details, `status --json` for structured output, or `status --verbose` -for the older detailed tables. The cascade includes "what broke" signals for -recent deployment readiness, pod restarts, node pressure, disk pressure, -Traefik 5xx/404 log evidence, and recent Gitea errors. +`status [all|oci|rpi|opi5|debian|cluster] [--json|--details]` +: Print a fast inventory-scoped overview. No scope checks all areas. Text +shows OK or FAILED, with warnings displayed as FAILED and skipped checks +omitted. JSON retains warning and skip states. Unscoped `status --deep` and +`status --json` retain the broader diagnostic cascade. See +[status overview](status-overview.md) for scope and probe limitations. `status --heal-plan` : Build a guarded self-heal plan from current status findings. This is @@ -125,11 +123,9 @@ docs freshness into a compact pass/warn/fail report. Report renderer : Report-oriented commands share `scripts/report-ui` and `scripts/report-render`. -The UI module emits status TSV rows, and the renderer prints compact grouped -summaries, detailed output, or JSON. Rows may include separate `fix`, `graph`, -and `query` fields for Grafana-backed checks. Default doctor/status output is -problems-first; pass `--all`, `--details`, `--json`, or `--verbose` when more -context is needed. +The UI emits TSV rows; status has a compact text view and focused doctor has a +narrative view. JSON preserves the structured diagnostic data used by existing +consumers. Specialized doctors may retain their own report formats. `gitops-status` : Print a focused Argo CD status view with application sync/health, out-of-sync @@ -308,6 +304,15 @@ writability, Pimox storage, OCI edge disk, and Pi-hole DNS. : Check Kubernetes component version alignment. Default output shows only warnings and failures; `--verbose` prints the old version table. +`doctor {oci|rpi|opi5|debian|cluster} [ITEM] [--ai|--json|--details]` +: Diagnose one area or an individual Compose or Argo CD item. An item can also +be supplied directly, for example `doctor gitea-runner`; direct lookup requires +its sources to be reachable and the name to be unambiguous. Selected-item AI +explanations are optional, evidence-validated hypotheses; `--no-local-rca` +disables them. The Gitea runner report uses deterministic evidence and asks +before starting an inactive Debian runner in an interactive terminal. See the +[focused doctor guide](doctor-overview.md). + `doctor-edge [--all|--details|--verbose|--json]` : Diagnose public edge routing, Traefik reachability, and Gitea edge exposure. Default output shows only warnings and failures. @@ -461,7 +466,7 @@ model. : Path to the canonical non-secret inventory. Defaults to `./homelab.yml`. `LAB_STATUS_LOG_SINCE` -: Log window for status log checks. Defaults to `30m`. +: Log window for deep status log checks. Defaults to `5m`. `LAB_STATUS_RESTART_THRESHOLD` : Pod restart count that turns the status restart-pressure check into a warning. @@ -492,8 +497,7 @@ the full output continues writing to the log file. `.lab/bin/jeannie-core`; wrappers build it on demand when Go is available. `LAB_STATUS_DETAILS=true` -: With `status --verbose`, append detailed host, Docker, Kubernetes, Pimox, RPi, -Tailscale, and HTTP tables after the normal status cascade. +: Legacy detailed status setting; concise status output remains the default. `LAB_STATUS_SHOW_OK_OUTPUT=true` : Show short command output for successful cascade checks. Failed and warning diff --git a/docs/templates/ai-ops.md.tmpl b/docs/templates/ai-ops.md.tmpl index 297a602..882ee3f 100644 --- a/docs/templates/ai-ops.md.tmpl +++ b/docs/templates/ai-ops.md.tmpl @@ -31,9 +31,9 @@ The split is: `jeannie-hermes`) plus `/data/homelab-ai-stack/ai-tools.env`. - `ai-check` verifies the knowledge index, wrappers, OmniRoute endpoint, and validated model route hints before Jeannie relies on them. -- Ollama remains on Debian for single-purpose local tasks such as translation - cache misses, but Holmes agentic Kubernetes triage should use the - OmniRoute-backed routes. +- Ollama remains on Debian for local inference. OmniRoute can route to local + or external providers; choose routes based on the task, privacy and measured + performance rather than assuming a particular provider is fastest. Bootstrap and validation from the Debian server: @@ -70,6 +70,15 @@ approvals and proposals. Depending on the OmniRoute route, the question, graph excerpt and source Goose reads may be sent to an external provider. Token savings depend on the model and task; the byte cap is not an exact token count. +## AI inference lab + +The optional [AI lab](ai-lab.md) installs pinned llama.cpp and Colibri builds +separately from production routes. `./{{ main_script }} ai-lab devices` reports +available devices, and `./{{ main_script }} ai-lab suite` repeats a set of +prompts across available backends. Compare response quality and timing along +with logs confirming actual device placement; the suite does not select a +winner or automatically change model routes. + ## Holmes-Assisted Kubernetes Doctor `doctor-k8s` is the first integration point between deterministic Jeannie @@ -85,7 +94,7 @@ for triage through the OmniRoute route selected in `models.env`. The evidence bundle identifies the selected profile, runtime, and control-plane node. Failed reads are marked unknown. Holmes must return JSON with cited check IDs; Jeannie renders facts from the evidence and validates citations and any -next command using the same rules as compact status explanations. An invalid +next command using the same rules as focused doctor explanations. An invalid response is rejected and the deterministic artifacts remain available. The private artifact directory holds the evidence, validated explanation, raw model response, and error log. Schema validation cannot prove a hypothesis correct. diff --git a/docs/templates/app-ops.md.tmpl b/docs/templates/app-ops.md.tmpl index 1deef5c..c937b9c 100644 --- a/docs/templates/app-ops.md.tmpl +++ b/docs/templates/app-ops.md.tmpl @@ -2,15 +2,17 @@ ## Current status and recent events -`./jeannie status` defaults to fast mode: it checks current host, cluster, -workload, DNS, registry, and public-route health without log scans, OCI backup -freshness, or an AI response. `./jeannie status --deep` adds those checks, -restart history, and inventory/storage checks. Add `--ai` to request an -unverified AI hypothesis for status or a doctor. `--no-local-rca` disables it; -`--verbose` implies deep mode. The -report identifies its mode, and fast mode cannot establish backup freshness or -the absence of recent errors. Healing collects deep evidence and rejects an -explicitly supplied fast status report. +`./jeannie status` provides a fast overview of Debian, the Orange Pi, RPi, +OCI edge, and the selected cluster. Choose an area with `status debian|opi5|rpi|oci|cluster`. +Text output shows OK or FAILED; warnings display as FAILED and skipped checks +are omitted. `status SCOPE --json` preserves underlying warning and skip +states. Use `./jeannie doctor SCOPE` or `doctor ITEM` for evidence and +diagnosis. See [status](status-overview.md) and [doctor](doctor-overview.md). + +The legacy unscoped `status --deep` and `status --json` use the diagnostic +cascade. Healing collects deep evidence and rejects an explicitly supplied +fast status report. Fast checks do not establish backup freshness or rule out +recent errors. After a planner-driven heal, Jeannie verifies the original finding with a focused live check: the affected Gitea endpoint/container, RPi DNS or service, @@ -19,8 +21,8 @@ verification rechecks the pinned identity. An unknown action is not declared healed; failed checks retry up to `LAB_HEAL_VERIFY_TIMEOUT_SECONDS` (default 180 seconds), with the configured verification interval. -Compact `status` and `doctor-homelab` run independent read-only probes in -parallel (four at a time by default, capped at eight). Set +Focused `status` and `doctor-homelab` run independent read-only probes in +parallel (focused status defaults to eight; report helpers cap at eight). Set `LAB_REPORT_PARALLELISM=1` to serialize them or `LAB_REPORT_TIMING=true` to print probe elapsed time. Identical selected HTTP/container probes reuse results only within that report. HTTP checks for the same URL also share one response @@ -31,12 +33,12 @@ per resource type as needed; snapshots are point-in-time, may differ across resource types, and are discarded when the report ends. API readiness, logs, identity checks, and healing verification continue to query live services. -Status examines Gitea and Traefik logs from the last five minutes by default; +Deep status diagnostics examine Gitea and Traefik logs from the last five minutes by default; `LAB_STATUS_LOG_SINCE` overrides the interval. A few Gitea client disconnects are informational only when its container, local HTTP, and public HTTP checks pass. Other log errors, repeated disconnects, or failed checks remain warnings and point to `doctor-gitea`. Information alone does not select a heal action. -With `--ai`, compact reports send structured findings to the selected model. +With `--ai`, supported doctor reports send structured findings to the selected model. Observed facts come from report rows. Hypotheses must cite existing check IDs; the next command must be an exact read-only command from the report and the allowlist. Invalid responses are rejected. Validation cannot prove a hypothesis @@ -544,18 +546,19 @@ binds the API to the configured LAN listener, and pulls the lightweight ./{{ main_script }} ollama-setup ``` -Compact status and doctor reports can request a validated explanation with -`--ai`. Verbose doctors skip the older unstructured backstage helper. The +Focused doctor reports can request a validated explanation with `--ai`. +Selected-item diagnosis enables it by default except for the deterministic +Gitea runner report; `--no-local-rca` disables it. The configured lightweight Ollama model is: ```bash ollama pull qwen2.5:0.5b ``` -For a deterministic report without a model, omit `--ai`: +For a deterministic report without a model: ```bash -./{{ main_script }} doctor-edge +./{{ main_script }} doctor debian --no-local-rca ``` Build the local homelab knowledge index separately from the main deployment: diff --git a/docs/templates/architecture.md.tmpl b/docs/templates/architecture.md.tmpl index 01405ea..61a0169 100644 --- a/docs/templates/architecture.md.tmpl +++ b/docs/templates/architecture.md.tmpl @@ -137,6 +137,12 @@ workload processes and Pimox VM power state. Deployment/start pipelines hold a shared lock and refuse conflicts. This does not prevent manual starts outside Jeannie. Switching modes requires stopping the previous runtime first. +The [network sandbox](network-sandbox.md) is separate from these cluster +profiles. Its OpenWrt VM and Alpine containers use a dedicated VLAN-aware +bridge, and their lifecycle does not gate K3s. WAN tests connect the sandbox +temporarily behind a host guard and disconnect it afterwards; selected probes +do not establish universal isolation. + `cluster-context.py` binds each profile to its API endpoint, CA fingerprint and `kube-system` UID. Its state root is `~/.local/share/homelab/clusters//`, with `identity.json` and separate diff --git a/docs/templates/deployment.md.tmpl b/docs/templates/deployment.md.tmpl index 44bf434..d185005 100644 --- a/docs/templates/deployment.md.tmpl +++ b/docs/templates/deployment.md.tmpl @@ -371,13 +371,13 @@ Run a read-only health snapshot from the Debian server with: and bootstrap through cluster lifecycle, reports, observability, recovery, access, apps, security, AI, and destructive commands. -`status` uses the reusable report UI and defaults to showing only failures and -warnings so the terminal stays readable. Use `./{{ main_script }} status --all` -to show every check, `--details` for row details, `--json` for structured -output, or `--verbose` for the older full host/Docker/Kubernetes/Pimox/RPi/ -Tailscale/HTTP dump. The cascade includes "what broke" signals such as -deployment readiness, pod restarts, node pressure, disk pressure, Traefik -5xx/404 log evidence, and recent Gitea errors. +`status` defaults to a fast overview of all inventory areas. Text output +shows OK or FAILED for each applicable check; warnings are displayed as FAILED +and skipped checks are omitted. Select a single area with `status debian`, +`status opi5`, `status rpi`, `status oci`, or `status cluster`. +Use `--json` after the area for structured output. The legacy unscoped +`status --deep` uses the broader diagnostic cascade. See the +[status guide](status-overview.md) for coverage and limitations. High-signal Prometheus alerts live in `apps/homelab-alerts`. They cover node readiness, pod restart storms, unavailable deployments, node/PVC storage @@ -517,9 +517,23 @@ dirty file count, and command details. entry, GitOps automation, cluster foundation, DNS, observability, and security learning paths. `./{{ main_script }} map --dot` emits Graphviz DOT. -Focused doctor commands run narrower read-only checks. They use the same -problems-first UI as `status`; add `--all`, `--details`, `--json`, or -`--verbose` when you need more context: +Focused doctors investigate one inventory area or item and show the collected +evidence. Select an area or item; there is no all-area mode: + +```bash +./{{ main_script }} doctor rpi +./{{ main_script }} doctor gitea-runner +./{{ main_script }} doctor debian homelab-gitea/gitea --details +./{{ main_script }} doctor cluster --json +./{{ main_script }} doctor rpi --ai +``` + +Item AI explanations use validated citations and can be disabled with +`--no-local-rca`; validation does not prove a hypothesis correct. The Gitea +runner has a deterministic report and can propose starting its inactive Debian +service, with interactive approval required. Other reports do not invent a fix +when the evidence is insufficient. See the [doctor guide](doctor-overview.md). +The earlier specialized doctors remain available: ```bash ./{{ main_script }} doctor-edge