Add OpsProof incident workspace
This commit is contained in:
parent
d35c2ddea0
commit
2583274377
|
|
@ -0,0 +1,149 @@
|
|||
interface Props {
|
||||
laravelVersion: string;
|
||||
}
|
||||
|
||||
const evidence = [
|
||||
['Service', 'k3s.service', 'failed', 'ExecMainStatus=1'],
|
||||
['Mount', '/var/lib/rancher/k3s', 'read-only', '/dev/sda1[/jeannie/k3s-runtime]'],
|
||||
['Device', 'Pinned SSD', 'reappeared', 'UUID 19972338-9757-4f4b-89d7-c202df14a9aa'],
|
||||
['Kernel', 'ext4', 'errors found', '__ext4_find_entry: reading directory'],
|
||||
];
|
||||
|
||||
const stages = [
|
||||
['01', 'Detect', 'Desired and observed state differ'],
|
||||
['02', 'Explain', 'Evidence supports a stale read-only mount'],
|
||||
['03', 'Approve', 'Guarded Jeannie repair awaits an operator'],
|
||||
['04', 'Prove', 'Identity and readiness checks validate recovery'],
|
||||
];
|
||||
|
||||
function Mark() {
|
||||
return (
|
||||
<div className="grid size-9 place-items-center rounded-xl bg-cyan-300 text-sm font-black text-slate-950 shadow-[0_0_28px_rgba(103,232,249,0.25)]">
|
||||
OP
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Welcome({ laravelVersion }: Props) {
|
||||
return (
|
||||
<main className="min-h-screen bg-[#071019] text-slate-100 selection:bg-cyan-300 selection:text-slate-950">
|
||||
<div className="pointer-events-none fixed inset-0 bg-[radial-gradient(circle_at_15%_10%,rgba(34,211,238,0.10),transparent_25%),radial-gradient(circle_at_85%_20%,rgba(99,102,241,0.12),transparent_28%)]" />
|
||||
|
||||
<div className="relative mx-auto max-w-7xl px-5 py-6 sm:px-8 lg:px-10">
|
||||
<header className="flex items-center justify-between border-b border-white/10 pb-5">
|
||||
<div className="flex items-center gap-3">
|
||||
<Mark />
|
||||
<div>
|
||||
<p className="font-semibold tracking-tight">OpsProof</p>
|
||||
<p className="text-xs text-slate-500">Evidence before action</p>
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex items-center gap-3 text-xs">
|
||||
<span className="hidden rounded-full border border-amber-300/30 bg-amber-300/10 px-3 py-1.5 text-amber-200 sm:inline">
|
||||
Sanitized demo
|
||||
</span>
|
||||
<span className="rounded-full border border-emerald-300/30 bg-emerald-300/10 px-3 py-1.5 text-emerald-200">
|
||||
Control plane available
|
||||
</span>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<section className="grid gap-8 py-12 lg:grid-cols-[1.05fr_0.95fr] lg:items-end">
|
||||
<div>
|
||||
<p className="mb-4 font-mono text-xs uppercase tracking-[0.24em] text-cyan-300">
|
||||
AI-assisted operations · human-approved repair
|
||||
</p>
|
||||
<h1 className="max-w-3xl text-4xl font-semibold leading-[1.05] tracking-[-0.04em] text-white sm:text-6xl">
|
||||
Turn infrastructure incidents into{' '}
|
||||
<span className="text-cyan-300">provable outcomes.</span>
|
||||
</h1>
|
||||
<p className="mt-6 max-w-2xl text-base leading-7 text-slate-400 sm:text-lg">
|
||||
OpsProof combines desired state, live evidence, cited AI reasoning, guarded Jeannie
|
||||
automation, and post-change validation in one auditable workflow.
|
||||
</p>
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-px overflow-hidden rounded-2xl border border-white/10 bg-white/10">
|
||||
{stages.map(([number, title, detail]) => (
|
||||
<div key={number} className="bg-[#0b1621] p-5">
|
||||
<p className="font-mono text-xs text-cyan-300">{number}</p>
|
||||
<p className="mt-4 font-semibold text-white">{title}</p>
|
||||
<p className="mt-1 text-xs leading-5 text-slate-500">{detail}</p>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section className="overflow-hidden rounded-3xl border border-white/10 bg-[#0a141e]/95 shadow-2xl shadow-black/30">
|
||||
<div className="flex flex-col gap-4 border-b border-white/10 px-6 py-5 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<p className="text-xs uppercase tracking-[0.2em] text-slate-500">Active incident · OP-0001</p>
|
||||
<h2 className="mt-1 text-xl font-semibold text-white">Orange Pi K3s storage became read-only</h2>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span className="rounded-full bg-rose-400/10 px-3 py-1.5 text-xs font-medium text-rose-300">High impact</span>
|
||||
<span className="rounded-full bg-cyan-400/10 px-3 py-1.5 text-xs font-medium text-cyan-200">4 evidence checks</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid lg:grid-cols-[1.15fr_0.85fr]">
|
||||
<div className="border-b border-white/10 p-6 lg:border-b-0 lg:border-r">
|
||||
<div className="mb-5 flex items-center justify-between">
|
||||
<h3 className="font-medium text-white">Command-backed evidence</h3>
|
||||
<span className="font-mono text-[11px] text-slate-600">COLLECTED 14:08:31Z</span>
|
||||
</div>
|
||||
<div className="space-y-3">
|
||||
{evidence.map(([kind, subject, state, proof]) => (
|
||||
<div key={`${kind}-${subject}`} className="grid gap-3 rounded-xl border border-white/8 bg-white/[0.025] p-4 sm:grid-cols-[90px_1fr_auto] sm:items-center">
|
||||
<span className="font-mono text-[11px] uppercase tracking-wider text-slate-600">{kind}</span>
|
||||
<div>
|
||||
<p className="text-sm font-medium text-slate-200">{subject}</p>
|
||||
<p className="mt-1 truncate font-mono text-[11px] text-slate-500">{proof}</p>
|
||||
</div>
|
||||
<span className="w-fit rounded-md bg-rose-400/10 px-2 py-1 text-[11px] text-rose-300">{state}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<aside className="p-6">
|
||||
<p className="text-xs uppercase tracking-[0.2em] text-slate-500">Diagnosis</p>
|
||||
<h3 className="mt-3 text-lg font-semibold text-white">Stale mount points to a disappeared device</h3>
|
||||
<p className="mt-3 text-sm leading-6 text-slate-400">
|
||||
The SSD reappeared under a new device name. Recovery must prove its pinned K3s CA before
|
||||
replacing the stale mount; device names alone are not trusted.
|
||||
</p>
|
||||
|
||||
<div className="mt-6 rounded-xl border border-cyan-300/20 bg-cyan-300/[0.06] p-4">
|
||||
<p className="text-xs font-medium uppercase tracking-wider text-cyan-200">Guarded proposal</p>
|
||||
<code className="mt-3 block overflow-x-auto text-xs text-cyan-100">
|
||||
./jeannie doctor opi5 --repair-k3s
|
||||
</code>
|
||||
<ul className="mt-4 space-y-2 text-xs leading-5 text-slate-400">
|
||||
<li>• Verify the disk against the pinned cluster CA</li>
|
||||
<li>• Refuse busy mounts instead of forcing unmount</li>
|
||||
<li>• Validate cluster identity and node readiness</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
disabled
|
||||
className="mt-5 w-full cursor-not-allowed rounded-xl bg-white/8 px-4 py-3 text-sm font-semibold text-slate-500"
|
||||
>
|
||||
Operator approval required
|
||||
</button>
|
||||
<p className="mt-3 text-center text-[11px] text-slate-600">
|
||||
Demo mode cannot submit changes
|
||||
</p>
|
||||
</aside>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<footer className="flex flex-col gap-2 py-8 text-xs text-slate-600 sm:flex-row sm:items-center sm:justify-between">
|
||||
<span>Built with Laravel Go {laravelVersion}, Inertia, React, TypeScript, Jeannie, and OpenTelemetry.</span>
|
||||
<span>Diagnosis is a hypothesis until deterministic validation passes.</span>
|
||||
</footer>
|
||||
</div>
|
||||
</main>
|
||||
);
|
||||
}
|
||||
|
|
@ -5674,6 +5674,7 @@ deploy_opsproof() {
|
|||
local go_sha256="${LAB_OPSPROOF_GO_SHA256:-7226736c2339719cda28fbf3a54d71aa63bcefe376e98cef00034268dab24840}"
|
||||
local starter_commit="${LAB_OPSPROOF_STARTER_COMMIT:-6dd8bd22b9d335e55b190aa16f3271e73c97cd25}"
|
||||
local starter_repo="${LAB_OPSPROOF_STARTER_REPO:-https://github.com/laravel/go.git}"
|
||||
local overlay_dir="${REPO_ROOT}/apps/opsproof/overlay"
|
||||
local service_user="${LAB_OPSPROOF_SERVICE_USER:-$(id -un)}"
|
||||
local toolchain_dir="${install_dir}/toolchains/go${go_version}"
|
||||
local release_dir="${install_dir}/releases/${starter_commit}"
|
||||
|
|
@ -5713,6 +5714,10 @@ deploy_opsproof() {
|
|||
return 1
|
||||
fi
|
||||
done
|
||||
if [[ ! -s "${overlay_dir}/resources/js/pages/Welcome.tsx" ]]; then
|
||||
echo "OpsProof UI overlay is missing from ${overlay_dir}." >&2
|
||||
return 1
|
||||
fi
|
||||
if ! node_major="$(node --version 2>/dev/null | sed -E 's/^v([0-9]+).*/\1/')" ||
|
||||
! [[ "${node_major}" =~ ^[0-9]+$ ]] || ((node_major < 22)); then
|
||||
echo "OpsProof requires Node.js 22 or newer on Debian." >&2
|
||||
|
|
@ -5745,6 +5750,7 @@ deploy_opsproof() {
|
|||
echo "Laravel Go starter checkout does not match the pinned commit." >&2
|
||||
return 1
|
||||
fi
|
||||
cp -a "${overlay_dir}/." "${build_dir}/"
|
||||
|
||||
(
|
||||
cd "${build_dir}"
|
||||
|
|
|
|||
|
|
@ -56,11 +56,23 @@ class OpsProofPipelineTests(unittest.TestCase):
|
|||
self.assertIn('go${go_version}.linux-amd64.tar.gz', pipeline)
|
||||
self.assertIn("6dd8bd22b9d335e55b190aa16f3271e73c97cd25", pipeline)
|
||||
self.assertIn("npm run check", pipeline)
|
||||
self.assertIn('cp -a "${overlay_dir}/." "${build_dir}/"', pipeline)
|
||||
self.assertIn("GOTOOLCHAIN=local go test ./...", pipeline)
|
||||
self.assertIn("opsproof.service", pipeline)
|
||||
self.assertIn("deploy-opsproof)", command)
|
||||
self.assertIn('"deploy-opsproof": true', server)
|
||||
|
||||
def test_opsproof_overlay_is_a_safe_demo_workspace(self):
|
||||
page = (ROOT / "apps/opsproof/overlay/resources/js/pages/Welcome.tsx").read_text(
|
||||
encoding="utf-8"
|
||||
)
|
||||
|
||||
self.assertIn("Turn infrastructure incidents", page)
|
||||
self.assertIn("Command-backed evidence", page)
|
||||
self.assertIn("Operator approval required", page)
|
||||
self.assertIn("Demo mode cannot submit changes", page)
|
||||
self.assertIn("./jeannie doctor opi5 --repair-k3s", page)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
|
|
|||
Loading…
Reference in New Issue