AI Engineering Workspace
PartialChat, files, terminal and preview in one place. Chat sessions run on a durable Postgres-backed queue (chat only: no tools or shell). Live models need an API key; the terminal is unavailable.
Project files
read-onlyapp/src/app/(app)/superadmin/acceptance/page.tsx
1import { Badge, Card, Notice, PageHeader } from "@/components/ui";2import { SignInCard } from "@/components/console-ui";3import { db } from "@/lib/db";4import { getCtx } from "@/lib/tenant";5import { resolveConfig } from "@/lib/config";6import { integrationStatus } from "@/lib/central";7import { trustedConnection } from "@/lib/tlsgate";8import { MODULES, moduleState } from "@/lib/modules";9import { Decide, BugForm } from "./client";10import { gateReport, activationOrgs } from "@/lib/gates";11import fs from "node:fs";12import path from "node:path";13export const dynamic = "force-dynamic"; export const metadata = { title: "Owner Acceptance Center" };14const AUTO: Record<string, [string, "ok" | "warn" | "err" | "neutral"]> = { functional: ["Verified functional (automated)", "ok"], partial: ["Partially implemented", "warn"], demo: ["Partially implemented", "warn"], awaiting: ["Awaiting credentials", "warn"], blocked: ["Blocked", "err"], notstarted: ["Not implemented", "neutral"] };15const EVIDENCE = [["Tenant isolation", "tenant-isolation"], ["Row-level security", "rls"], ["OIDC token checks", "oidc-core"], ["OIDC flow", "oidc-flow"], ["Central readiness", "central"], ["Owner auth", "owner-auth"], ["Nexus contract", "nexus"], ["Application QA", "results"], ["Deployment flow (same-host)", "deploy-flow"], ["Proxy (stub Caddy)", "proxy"], ["Security gates", "gates"]];16export default async function Acceptance() {17 const ctx = await getCtx(); if (!ctx) return <SignInCard what="the owner acceptance center" />;18 if (!ctx.platformAdmin) return <Notice tone="err" title="Platform owner only">Acceptance testing is performed by the platform owner.</Notice>;19 const d = db(); const cfg = await resolveConfig(); const base = cfg.PUBLIC_BASE_URL.value.replace(/\/$/, "");20 const acc = Object.fromEntries((await d.prepare("SELECT * FROM acceptance").all() as any[]).map(a => [a.module_key, a]));21 const bugs = await d.prepare("SELECT * FROM acceptance_bugs ORDER BY created_at DESC LIMIT 50").all() as any[];22 const rel = await d.prepare("SELECT version,commit_sha,status,started_at FROM deployments ORDER BY started_at DESC LIMIT 8").all() as any[];23 const integ = await integrationStatus(); const tc = await trustedConnection();24 const gr = await gateReport(); const act = await activationOrgs(); const ext = (() => { try { return JSON.parse(fs.readFileSync(path.resolve(process.cwd(), "../design/verification/external-vps.json"), "utf8")); } catch { return null; } })();25 const TESTS: [string, string, "ok" | "warn" | "err" | "neutral"][] = [["Static + Node deployment, logs, start/stop/restart, failure recovery, rollback, rotation, upgrade, revocation, uninstall", "LOCAL only: agent on the same host as the control plane", "warn"], ["Reverse proxy (validation, reload, rollback, health)", "STUB caddy only; no real Caddy", "warn"], ["Positive DNS ownership verification", "unit-tested; live positive path not run (no customer domain)", "warn"], ["Trusted certificate issuance for customer domains / auto-renewal", "NOT RUN (needs Caddy + ports 80/443)", "err"], ["Independent external VPS", ext?.independent ? `PASSED ${ext.passed}/${ext.passed + ext.failed}` : "NOT RUN (no separately authorized server)", ext?.independent ? "ok" : "err"], ["Standard HTTPS on :443", "NOT DONE (owner action: deploy/caddy/owner-install.sh)", "err"], ["Zoo IAM / Central / Nexus live", "NOT CONNECTED (no credentials or contracts)", "err"]];26 const rows = MODULES.map(m => { const st = moduleState(m.id); const a = acc[m.id]; const manual = a?.status ?? "pending"; return { m, st, manual, note: a?.note, by: a?.updated_by, at: a?.updated_at }; });27 const count = (f: (r: (typeof rows)[number]) => boolean) => rows.filter(f).length;28 return (29 <div className="space-y-6">30 <PageHeader title="Owner Acceptance Center" desc="Every module with its automated state, how to test it, and your own accept / reject decision. Manual acceptance is never set automatically." />31 <Notice tone="info" title="How to read this">“Verified functional” is the project's automated evidence only. A module becomes Accepted only when you press Accept. Nothing here claims commercial production readiness.</Notice>32 <div className="grid gap-3 sm:grid-cols-2 lg:grid-cols-4">33 <Card><div className="text-xs text-muted-foreground">Modules</div><div className="text-2xl font-semibold">{rows.length}</div></Card>34 <Card><div className="text-xs text-muted-foreground">Awaiting your acceptance</div><div className="text-2xl font-semibold">{count(r => r.st === "functional" && r.manual === "pending")}</div></Card>35 <Card><div className="text-xs text-muted-foreground">Accepted by you</div><div className="text-2xl font-semibold">{count(r => r.manual === "accepted")}</div></Card>36 <Card><div className="text-xs text-muted-foreground">Open bugs</div><div className="text-2xl font-semibold">{bugs.filter(b => b.status === "open").length}</div></Card></div>37 <Card title="Launch"><div className="space-y-1 p-4 text-sm"><div>Landing: <a className="underline" href={base + "/"}>{base}/</a> · Sign in: <a className="underline" href={base + "/login"}>/login</a> · Customer console: <a className="underline" href={base + "/console"}>/console</a> · Super Admin: <a className="underline" href={base + "/superadmin/platform"}>/superadmin/platform</a></div>38 <div className="flex flex-wrap items-center gap-2 break-words">Connection: {tc.ok ? <Badge tone="ok">Trusted HTTPS verified</Badge> : <Badge tone="warn">Not on the trusted host</Badge>}<span className="min-w-0 break-words text-xs text-muted-foreground">{tc.ok ? `${tc.host} · certificate valid until ${tc.validTo}` : tc.reason}</span></div>39 <div className="text-muted-foreground">Evidence: {EVIDENCE.map(([l, f], i) => <span key={f}>{i ? " · " : ""}<a className="underline" href={`/design-assets/verification/${f}.json`}>{l}</a></span>)}</div></div></Card>40 <Card title="Customer activation gates"><div className="space-y-2 p-4 text-sm"><p className="text-xs text-muted-foreground">Computed from live checks and recorded test evidence, not attestations. Customer sign-in stays OFF until every gate passes AND you list the organizations to admit. Admitted organizations now: {act.length ? act.join(", ") : "none"}.</p>41 <ul className="grid gap-1 sm:grid-cols-2">{gr.gates.map(g => <li key={g.id} className="flex items-start gap-2"><Badge tone={g.pass ? "ok" : "err"}>{g.pass ? "pass" : "fail"}</Badge><span className="min-w-0 break-words">{g.title}<span className="block text-xs text-muted-foreground">{g.detail}</span></span></li>)}</ul>42 <div className="text-xs">{gr.allPass ? "All mandatory gates pass: you may attest and allowlist test customers from Super Admin." : "Not all gates pass: attestation is refused by the server."}</div></div></Card>43 <Card title="What was actually tested (scope labels)"><ul className="space-y-1 p-4 text-sm">{TESTS.map(([n, v, t]) => <li key={n} className="flex flex-wrap items-start gap-2"><Badge tone={t}>{t === "ok" ? "verified" : t === "warn" ? "limited" : "not done"}</Badge><span className="min-w-0 break-words">{n}<span className="block text-xs text-muted-foreground">{v}</span></span></li>)}</ul></Card>44 <Card title="Modules"><div className="divide-y divide-border">{rows.map(({ m, st, manual, note, by, at }) => (45 <details key={m.id} className="p-4"><summary className="flex cursor-pointer flex-wrap items-center gap-2"><span className="font-mono text-xs">{m.id}</span><span className="font-medium">{m.title}</span>46 <Badge tone={AUTO[st][1]}>{AUTO[st][0]}</Badge>{st === "functional" && manual === "pending" && <Badge tone="warn">Awaiting owner acceptance</Badge>}{manual === "accepted" && <Badge tone="ok">Accepted by owner</Badge>}{manual === "rejected" && <Badge tone="err">Rejected by owner</Badge>}</summary>47 <div className="mt-3 grid gap-3 text-sm md:grid-cols-[1fr_16rem]"><div>48 <div><b>Test:</b> sign in, open <a className="underline" href={m.href}>{m.href}</a> and exercise each feature below. <b>Expected:</b> a feature marked Functional works end-to-end with real data; any other state shows an honest label instead of a simulated result.</div>49 <ul className="mt-2 space-y-1">{m.features.map(f => <li key={f.name}><Badge tone={f.state === "functional" ? "ok" : f.state === "blocked" ? "err" : f.state === "notstarted" ? "neutral" : "warn"}>{f.state}</Badge> {f.name}{f.note ? <span className="text-muted-foreground"> — {f.note}</span> : null}</li>)}</ul>50 {note && <div className="mt-2 text-muted-foreground">Your note: {note} ({by}, {at})</div>}</div>51 <div><Decide moduleKey={m.id} current={manual} /></div></div></details>))}</div></Card>52 <div className="grid gap-4 lg:grid-cols-2">53 <Card title="Bugs"><div className="space-y-3 p-4"><BugForm modules={MODULES.map(m => ({ id: m.id, title: m.title }))} />54 <ul className="space-y-1 text-sm">{bugs.length ? bugs.map(b => <li key={b.id}><Badge tone={b.status === "open" ? "warn" : "neutral"}>{b.status}</Badge> <Badge tone={b.severity === "blocker" ? "err" : "neutral"}>{b.severity}</Badge> {b.title}</li>) : <li className="text-muted-foreground">No bugs filed.</li>}</ul></div></Card>55 <Card title="Release history"><ul className="space-y-1 p-4 text-sm">{rel.map(r => <li key={r.version + r.started_at}><span className="font-mono">{r.version}</span> · {String(r.commit_sha ?? "").slice(0, 7)} · {r.status} · {String(r.started_at).slice(0, 10)}</li>)}</ul></Card></div>56 <Card title="Integration health"><div className="divide-y divide-border">{integ.map(a => <div key={a.id} className="flex items-center justify-between gap-2 p-3 text-sm"><span>{a.title}</span><Badge tone={a.state === "live" ? "ok" : a.state === "blocked" ? "err" : "neutral"}>{a.state === "contract-prepared" ? "Cloud side prepared" : a.state}</Badge></div>)}</div></Card>57 </div>58 );59}60
Conversation
PartialSign in to start AI sessions.
Task checklist
- Application shell deployed
- Persistent projects
- Agent runtime
- Sandboxed terminal
Execution activity
No agent sessions. Git HEAD 0eebc42 on master.
Approval requests
None pending.