Concepts¶
The objects and parts you meet when you run Shadewright, and how they relate. This page summarises; the reasoning is in the design, linked in each section. Fields are in the API reference.
Built and planned
Only the executor's path from a RemediationRequest to a pull request that waits for a person is built end to end. The analyzer records Incidents; it diagnoses and proposes only when started with --triage-model, which is off by default and, until the analyzer checks the evaluation results and fails closed (ADR-0025 decision 7), meant for an evaluation run in the lab. So today a person (or a test) writes the RemediationRequest. Built parts are marked built, designed ones planned. The home page status has the full list.
How the parts relate¶
flowchart LR
ev([Events and pod status in watched namespaces])
subgraph analyzer [Analyzer: read-only identity]
col[Collector]
inc[Incident]
diag[Diagnosis and proposal]
end
rr[RemediationRequest]
subgraph executor [Executor: Git identity]
pol[Policy check]
pr[Pull request step]
end
cfg[(RemediationPolicy and RemediationSettings)]
git[(GitOps repository)]
person([A person reviews and merges])
flux[GitOps controller]
ev --> col --> inc
inc --> diag
diag --> rr
rr --> pol
cfg --> pol
pol --> pr --> git
git --> person --> flux
All of it is built. The analysis that turns an Incident into a request runs only when the analyzer is started with --triage-model, so in a default install no request comes from it (design 3.3). The full flow is in design 2.
Incident built¶
One problem on one workload, kept as a namespaced object in the operator namespace. The collector turns Warning events and pod status into observations, redacts them, and the Incident controller keeps one Incident per fingerprint with counters and first and last seen times. It holds no logs. Repeated symptoms update the same Incident. See design 3 and read an Incident.
RemediationRequest built¶
One concrete plan: which action, on which target (pinned by UID), the previous and the desired value. It says what to change, never where: the executor finds the repository, branch and file from the Flux objects that deliver the target. The spec is immutable but for spec.cancel, which a person sets to cancel the request before the merge, so a different plan is a new request and an approval never carries over. Only the executor writes its status (phase and conditions). See design 5.1 and the life of a request.
RemediationPolicy built¶
A cluster-scoped object that only the cluster admin should be able to write. It lists the actions allowed, with minimum, maximum and percent bounds; the target namespaces and labels; the Git paths that may be patched; the repository by name; the namespaces whose requests may use it; and whether review is always required. Safe defaults: review required, no decreases, no "all namespaces". A request outside any bound is Denied. See design 5.3 and write or tighten a policy.
RemediationSettings built¶
One cluster-scoped object named default. It holds the kill switch (spec.paused), the concurrency limit, the analysis limits (only maxAnalysesPerDay is read today), the Git repositories Shadewright may open pull requests in (URL, target branch, GitHub App and Key Vault key), and the module list. The analyzer also writes a detection report to its status; no component reads that status to decide anything. See design 5.4 and the configuration reference.
The action catalog built¶
The closed list of changes Shadewright can make. Each action is an enum value with typed, bounded parameters, its own policy rule and its own patcher. There are two:
| Action | Changes | Target kind |
|---|---|---|
SetContainerMemoryLimit |
A container's memory limit | apps/v1 Deployment or StatefulSet |
AdjustKedaMaxReplicas |
maxReplicaCount of a KEDA ScaledObject (needs the keda module enabled) |
keda.sh/v1alpha1 ScaledObject |
There is no free-form command, no exec and no direct apply. See design 5.1 and ADR-0003.
The analyzer, the executor and the verifier, and why they are separate¶
They are three binaries, three Deployments, three ServiceAccounts and three identities.
- The analyzer reads the cluster and writes only Incidents, its analysis budget ConfigMap, the requests it proposes and the settings status. Model access belongs to it alone. It has no Git credential.
- The executor reconciles requests, runs the policy check, and is the only component with the Git App. It cannot read Secrets and does not call a model.
- The verifier (
shadewright-verifier) samples the pods of a rollout after a merge and writes aVerificationReportfor each request inVerifying(only with the executor's--verify-outcomes, off by default). It has no model access, no Git App and no Secrets, and it never writes request status: its report is evidence that the executor reads, not a verdict: the executor judgesClearedfrom it and decides the end.
A model's output is therefore only ever a proposal that the analyzer writes as a request, and deterministic policy in the executor decides whether it may run. A slow model call also cannot block the executor. See design 2.2 and design 9.
Where the model sits in the loop¶
Shadewright is a Kubernetes controller: it observes, decides and acts against a goal, with its state in CRDs and its limits in policy. A model takes part in one step of that loop, the diagnosis, because that step has to read text (events, logs, recent Git changes) and choose a fix that nobody wrote down in advance. Every other step is deterministic code:
flowchart TB
obs[Observe: collector, Incidents]
subgraph diagnose [Diagnose]
direction LR
rb[Runbook, when one matches]
model[Model, for the rest]
end
dec[Decide: policy in the executor]
act[Act: pull request, review, GitOps controller]
ver[Verify: deterministic checks, then observe again]
obs --> diagnose
rb -.-> dec
model -.-> dec
dec --> act
act -.-> ver
classDef planned stroke-dasharray: 5 5
class rb planned
Dashed boxes are planned: no runbook exists yet. The verifier is built: it is deployed when verifier.watchNamespaces (or the analyzer's) is set and writes a VerificationReport only for requests in Verifying, which they reach only with the executor flag --verify-outcomes (off by default), so a default install writes no reports. The executor reads the report as untrusted evidence and decides Cleared (#683): with the flag on and a verifier deployed, a merged request ends Succeeded, Failed or Inconclusive; with the flag on and no verifier it ends Inconclusive; with the flag off nothing after Merged runs. The model path is built but off by default (--triage-model), and until the analyzer checks the evaluation results and fails closed, a run with a real model is a lab evaluation, not production use (see the note at the top). So the model never tries a fix, checks the result and tries again on its own. Its output is one proposal, and the loop around it stays the same as in any other controller.
A known problem with a known fix belongs in a runbook, which makes no model call; the model is for incidents no runbook matched (design 3.3). No runbook ships yet, so today every analysis takes the model path.
Autoscaling and reconcile loops need no model at all, and they already have controllers that own them (an HPA, KEDA, Flux). Shadewright changes their declarations in Git and never competes with them for the same fields (design 7).
Observe-only mode built¶
What you get from the install in observe-only mode: the analyzer watches the namespaces you name and records Incidents, no RemediationSettings entry names a repository, and spec.paused is true, so the executor could not write to Git even if a request existed. It is the recommended first state, see install in observe-only mode.
Where to go next¶
- The life of a request: phases and conditions.
- How-to guides: one task each.
- Glossary and FAQ.