diff --git a/apps/opsproof/README.md b/apps/opsproof/README.md index 9a2beb6..d484b57 100644 --- a/apps/opsproof/README.md +++ b/apps/opsproof/README.md @@ -145,6 +145,11 @@ The first complete scenario will model the Orange Pi K3s storage incident: - validation: pinned cluster identity, node readiness, and application health; - report: findings, diagnosis, 5 Whys, mitigation, and validation evidence. +The public demo now presents a sanitized fixture of this completed scenario, +including bounded evidence, the approval-gated repair, rollback boundary, +post-change validation, Five Whys, and a prevention recommendation. It never +connects to Jeannie or exposes private infrastructure data. + This scenario is valuable to a prospective client because it demonstrates diagnosis, safety design, AI-assisted reasoning, infrastructure automation, observability, and a verified operational outcome rather than a chat demo. diff --git a/apps/opsproof/overlay/handlers/demo/show.go b/apps/opsproof/overlay/handlers/demo/show.go index 01cfcf7..97c9160 100644 --- a/apps/opsproof/overlay/handlers/demo/show.go +++ b/apps/opsproof/overlay/handlers/demo/show.go @@ -8,18 +8,28 @@ import ( func Show(*web.Request) *web.Response { return inertia.Render("Demo", inertia.Props{ "demo": inertia.Props{ - "scope": "cluster", "target": "example-api", "outcome": "validated", - "finding": "A disposable application repeatedly restarted after a configuration rollout.", - "diagnostic": "Focused evidence linked the restarts to one invalid application setting; node and storage checks remained healthy.", - "proposal": "Run the constrained Jeannie Doctor repair for the affected application.", - "rollback": "Restore the previous application revision and confirm readiness before reopening traffic.", - "validation": "The execution completed and a fresh focused Doctor run returned no warning or failing evidence.", + "scope": "opi5", "target": "k3s-storage", "outcome": "validated", + "finding": "The Orange Pi K3s service failed after its USB SSD disappeared and the stale ext4 mount was remounted read-only.", + "diagnostic": "The mounted runtime still referenced the vanished block-device identity. The SSD later reappeared under a different Linux device name, so its name alone was not trusted.", + "proposal": "Run the constrained doctor opi5 --repair-k3s workflow only after matching the reappeared filesystem to the pinned K3s CA and cluster identity.", + "rollback": "Keep K3s stopped and leave the replacement mount disconnected if the filesystem UUID, pinned CA, or live cluster identity does not match.", + "validation": "The guarded workflow verified the pinned CA, remounted the intended filesystem read-write, started K3s, confirmed the pinned cluster identity, and observed the Orange Pi node Ready.", "evidence": []inertia.Props{ - {"id": "C01", "status": "fail", "check": "Application readiness", "summary": "Desired 1, ready 0"}, - {"id": "C02", "status": "warn", "check": "Container restarts", "summary": "Restart backoff observed"}, - {"id": "C03", "status": "ok", "check": "Post-change validation", "summary": "Desired state satisfied"}, + {"id": "C01", "status": "fail", "check": "K3s service", "summary": "Service exited while its runtime filesystem was unavailable"}, + {"id": "C02", "status": "fail", "check": "Runtime mount", "summary": "Stale ext4 mount was read-only and its original block device was absent"}, + {"id": "C03", "status": "warn", "check": "Filesystem evidence", "summary": "Kernel journal recorded repeated ext4 directory read errors"}, + {"id": "C04", "status": "ok", "check": "Identity validation", "summary": "Reappeared SSD contained the pinned K3s CA and expected cluster identity"}, + {"id": "C05", "status": "ok", "check": "Post-change validation", "summary": "Filesystem was read-write, K3s was active, and the node was Ready"}, }, - "notice": "Sanitized fixture only. This public route has no Jeannie client, credentials, approval, or execution capability.", + "fiveWhys": []string{ + "K3s was unavailable because its service could not use the runtime directory.", + "The runtime directory was unavailable because the backing ext4 mount was stale and read-only.", + "The mount became stale because the USB SSD disappeared while the kernel retained the old mounted device identity.", + "The returning SSD received a different Linux device name, so an automatic name-based remount would have been unsafe.", + "Recovery must identify storage by durable filesystem and cluster identity, then validate the service and node before declaring success.", + }, + "recommendation": "Keep the identity-pinned recovery in Jeannie, alert on read-only K3s storage, and investigate the USB power, cable, enclosure, and host-controller path if the disconnect recurs.", + "notice": "Sanitized fixture only. This public route has no Jeannie client, credentials, approval, or execution capability.", }, }) } diff --git a/apps/opsproof/overlay/resources/js/pages/Demo.tsx b/apps/opsproof/overlay/resources/js/pages/Demo.tsx index 23ebaa5..e4a1b9e 100644 --- a/apps/opsproof/overlay/resources/js/pages/Demo.tsx +++ b/apps/opsproof/overlay/resources/js/pages/Demo.tsx @@ -7,6 +7,8 @@ interface Demo { proposal: string; rollback: string; validation: string; + fiveWhys: string[]; + recommendation: string; notice: string; evidence: Array<{ id: string; status: string; check: string; summary: string }>; } @@ -52,6 +54,24 @@ export default function DemoPage({ demo }: { demo: Demo }) { ))} +
+
+

Five Whys

+
    + {demo.fiveWhys.map((why, index) => ( +
  1. + {index + 1} + {why} +
  2. + ))} +
+
+
+

Recommendation

+

{demo.recommendation}

+
+
+ diff --git a/apps/opsproof/overlay/tests/feature/demo_test.go b/apps/opsproof/overlay/tests/feature/demo_test.go index 8784f12..1323e4f 100644 --- a/apps/opsproof/overlay/tests/feature/demo_test.go +++ b/apps/opsproof/overlay/tests/feature/demo_test.go @@ -14,5 +14,8 @@ func TestPublicDemoUsesSanitizedFixtureWithoutAuthentication(t *testing.T) { "OPSPROOF_JEANNIE_TOKEN": "must-not-be-used", })) client.WithoutRedirects().Get("/").AssertRedirect("/demo") - client.Get("/demo").AssertOK().AssertInertia("Demo").AssertProp("demo.outcome", "validated") + client.Get("/demo").AssertOK().AssertInertia("Demo"). + AssertProp("demo.scope", "opi5"). + AssertProp("demo.target", "k3s-storage"). + AssertProp("demo.outcome", "validated") } diff --git a/apps/opsproof/overlay/tests/feature/welcome_test.go b/apps/opsproof/overlay/tests/feature/welcome_test.go index 6677c6d..eb5781a 100644 --- a/apps/opsproof/overlay/tests/feature/welcome_test.go +++ b/apps/opsproof/overlay/tests/feature/welcome_test.go @@ -8,5 +8,7 @@ import ( func TestTheWelcomePageRenders(t *testing.T) { client := tests.New(t) - client.Get("/").AssertOK().AssertInertia("Demo").AssertProp("demo.outcome", "validated") + client.Get("/").AssertOK().AssertInertia("Demo"). + AssertProp("demo.target", "k3s-storage"). + AssertProp("demo.outcome", "validated") } diff --git a/tests/jeannie/test_privacy_services_pipeline.py b/tests/jeannie/test_privacy_services_pipeline.py index 71c5f57..8879d51 100644 --- a/tests/jeannie/test_privacy_services_pipeline.py +++ b/tests/jeannie/test_privacy_services_pipeline.py @@ -196,8 +196,17 @@ class OpsProofPipelineTests(unittest.TestCase): ROOT / "apps/opsproof/overlay/handlers/demo/show.go" ).read_text(encoding="utf-8") self.assertIn("Sanitized fixture only", demo_handler) + self.assertIn('"target": "k3s-storage"', demo_handler) + self.assertIn('"fiveWhys": []string{', demo_handler) + self.assertIn('"recommendation":', demo_handler) self.assertNotIn("Jeannie.", demo_handler) + demo_page = ( + ROOT / "apps/opsproof/overlay/resources/js/pages/Demo.tsx" + ).read_text(encoding="utf-8") + self.assertIn("Five Whys", demo_page) + self.assertIn("demo.recommendation", demo_page) + edge = (ROOT / "bootstrap/edge/templates/default.conf.tftpl").read_text( encoding="utf-8" ) @@ -218,6 +227,7 @@ class OpsProofPipelineTests(unittest.TestCase): ).read_text(encoding="utf-8") self.assertIn("TestTheWelcomePageRenders", welcome_test) self.assertIn('AssertInertia("Demo")', welcome_test) + self.assertIn('AssertProp("demo.target", "k3s-storage")', welcome_test) if __name__ == "__main__":