my-homelab-configs/docs/opsproof-architecture.md

81 lines
3.0 KiB
Markdown

# OpsProof architecture
## Decision
Use Laravel Go as the OpsProof web application, with Inertia, React, and
TypeScript for the browser experience. Deploy it as an independent Debian
service and keep Jeannie as the sole remediation authority.
Laravel Go and Laravel Rust both provide a compiled full-stack Laravel runtime,
Inertia support, and OpenTelemetry. Laravel Go is the better fit here because:
- Jeannie's API and workflow worker are already written in Go;
- Go's fast compile cycle is useful while Laravel's new runtimes are in beta;
- the application is primarily an orchestration and evidence UI, not a
CPU-bound component that benefits materially from Rust's additional
performance;
- one systems language reduces maintenance and makes the portfolio story more
coherent.
This is a reversible decision. Laravel Go remains behind an HTTP boundary and
must not be imported into the root Go module.
## Component boundaries
```text
browser
|
| Inertia pages and form submissions
v
OpsProof on Debian
|-- session, Dex identity, authorization
|-- incident/proposal/audit records
|-- redaction and public-demo projection
|
| authenticated structured requests
v
Jeannie API on Debian
|-- command allowlist
|-- status and Doctor evidence
|-- execution tracking
|-- Temporal-backed long operations
v
homelab targets (Debian, OCI, RPi, Orange Pi, Kubernetes)
```
OpsProof may link to Grafana, Loki, Tempo, and change-journal artifacts, but
their data does not grant execution authority. AI explanations must cite the
evidence identifiers supplied to the model and remain visibly unverified until
confirmed by deterministic validation.
## Deployment constraints
- Run on Debian so a Kubernetes outage does not remove the incident UI.
- Build with a pinned Laravel Go dependency and Go 1.27 or newer.
- Publish a health endpoint independently from Jeannie health.
- Send Laravel Go's OpenTelemetry traces to the existing Debian monitoring
stack.
- Store the Jeannie bearer token server-side only.
- Use Dex OIDC for operator mode; never expose operator actions in public demo
mode.
- Fail closed when Jeannie is unreachable or its advertised command surface
differs from the proposal.
## Why not Laravel Rust now?
Laravel Rust is a credible future option, particularly for a high-throughput or
memory-constrained product. OpsProof's latency is dominated by remote checks,
Doctor analysis, and remediation workflows. Rust would not improve those paths
enough to justify another toolchain in the first version. A later comparison
can implement the same read-only overview against the stable contract and
measure build time, binary size, memory, and request throughput.
## Non-goals for the first version
- arbitrary shell execution;
- autonomous remediation without operator approval;
- replacing Jeannie, Holmes, Temporal, or Argo CD;
- storing raw infrastructure secrets in the UI database;
- making Kubernetes a runtime dependency for OpsProof availability;
- presenting sanitized portfolio fixtures as live production data.