diff --git a/Dockerfile.web b/Dockerfile.web
index d574ea9..e26dfa5 100644
--- a/Dockerfile.web
+++ b/Dockerfile.web
@@ -13,7 +13,8 @@ RUN apk add --no-cache git wget \
&& corepack enable \
&& corepack prepare pnpm@9.15.9 --activate
-RUN git clone --depth 1 --branch "${C0PY_REF}" "${C0PY_REPO}" /app
+RUN git clone --depth 1 --branch "${C0PY_REF}" "${C0PY_REPO}" /app \
+ && git -C /app rev-parse HEAD > /app/.c0py-commit
WORKDIR /app
@@ -28,6 +29,6 @@ ENV NEXT_TELEMETRY_DISABLED=1
EXPOSE 3000
HEALTHCHECK --interval=30s --timeout=5s --start-period=15s --retries=3 \
- CMD wget -qO- http://127.0.0.1:3000/ >/dev/null 2>&1 || exit 1
+ CMD wget -qO- http://127.0.0.1:3000/api/health >/dev/null 2>&1 || exit 1
CMD ["pnpm", "--filter", "@siax/c0py-web", "start"]
diff --git a/apps/web/src/app/api/health/route.ts b/apps/web/src/app/api/health/route.ts
new file mode 100644
index 0000000..b3a6f3c
--- /dev/null
+++ b/apps/web/src/app/api/health/route.ts
@@ -0,0 +1,29 @@
+import { readFileSync } from "node:fs";
+import { apiBaseUrl } from "../../../lib/api-status";
+
+/** Build commit, written by Dockerfile.web into .c0py-commit at image build time. */
+function commit(): string {
+ const fromEnv = process.env.C0PY_WEB_COMMIT?.trim();
+ if (fromEnv) return fromEnv;
+ for (const path of [".c0py-commit", "/app/.c0py-commit"]) {
+ try {
+ const value = readFileSync(path, "utf8").trim();
+ if (value) return value;
+ } catch {
+ /* not present in this environment */
+ }
+ }
+ return "unknown";
+}
+
+export const dynamic = "force-dynamic";
+
+export function GET() {
+ return Response.json({
+ status: "ok",
+ service: "c0py-web",
+ commit: commit(),
+ apiBaseUrl: apiBaseUrl(),
+ time: new Date().toISOString(),
+ });
+}
diff --git a/apps/web/src/app/icon.svg b/apps/web/src/app/icon.svg
new file mode 100644
index 0000000..871dd47
--- /dev/null
+++ b/apps/web/src/app/icon.svg
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/apps/web/src/app/layout.tsx b/apps/web/src/app/layout.tsx
index 167de53..9f14b75 100644
--- a/apps/web/src/app/layout.tsx
+++ b/apps/web/src/app/layout.tsx
@@ -1,3 +1,44 @@
+import type { Metadata } from "next";
+
+export const metadata: Metadata = {
+ title: "C0PY — evidence-driven capture console",
+ description:
+ "C0PY is the canonical SIAX engine for evidence-driven web product capture, digital-twin specification, reconstruction and verification.",
+};
+
+const globalCss = `
+ :root {
+ --c0py-ink: #15151b;
+ --c0py-accent: #5326cc;
+ --c0py-paper: #ffffff;
+ --c0py-muted: #5b5b66;
+ --c0py-line: #e4e4ec;
+ --c0py-band: #15151b;
+ --c0py-ok: #1b7f4f;
+ --c0py-warn: #96591a;
+ }
+ * { box-sizing: border-box; }
+ html, body { margin: 0; padding: 0; }
+ body {
+ background: var(--c0py-paper);
+ color: var(--c0py-ink);
+ font-family: Inter, "Inter var", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
+ font-size: 16px;
+ line-height: 1.55;
+ -webkit-font-smoothing: antialiased;
+ }
+ h1, h2, h3 { color: var(--c0py-ink); margin: 0; font-weight: 650; letter-spacing: -0.01em; }
+ a { color: var(--c0py-accent); }
+ code, .mono { font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.875em; }
+`;
+
export default function RootLayout({ children }: { children: React.ReactNode }) {
- return
{children};
+ return (
+
+
+
+
+ {children}
+
+ );
}
diff --git a/apps/web/src/app/page.tsx b/apps/web/src/app/page.tsx
index 6435975..0f336dc 100644
--- a/apps/web/src/app/page.tsx
+++ b/apps/web/src/app/page.tsx
@@ -1,4 +1,134 @@
-// Placeholder - Next.js app router entry
-export default function Home() {
- return c0py
;
+import { API_SURFACE, PIPELINE, apiBaseUrl, fetchApiStatus } from "../lib/api-status";
+
+export const dynamic = "force-dynamic";
+
+const band: React.CSSProperties = {
+ background: "var(--c0py-band)",
+ color: "#f6f6fa",
+ padding: "1.1rem 1.5rem",
+ display: "flex",
+ gap: "0.9rem",
+ alignItems: "baseline",
+ flexWrap: "wrap",
+};
+const shell: React.CSSProperties = {
+ maxWidth: 1020,
+ margin: "0 auto",
+ padding: "2rem 1.5rem 3.5rem",
+ borderLeft: "4px solid var(--c0py-accent)",
+};
+const panel: React.CSSProperties = {
+ border: "1px solid var(--c0py-line)",
+ borderRadius: 10,
+ padding: "1.1rem 1.25rem",
+ marginTop: "1.25rem",
+};
+const th: React.CSSProperties = {
+ textAlign: "left",
+ borderBottom: "1px solid var(--c0py-line)",
+ padding: "0.45rem 0.6rem",
+ fontSize: "0.78rem",
+ textTransform: "uppercase",
+ letterSpacing: "0.06em",
+ color: "var(--c0py-muted)",
+};
+const td: React.CSSProperties = {
+ borderBottom: "1px solid var(--c0py-line)",
+ padding: "0.45rem 0.6rem",
+ verticalAlign: "top",
+};
+
+export default async function Home() {
+ const base = apiBaseUrl();
+ const api = await fetchApiStatus(base);
+
+ return (
+ <>
+
+ C0PY
+
+ SIAX · evidence-driven capture, digital-twin specification and verification
+
+
+
+
+ Capture console
+
+ C0PY consumes an authorized web target and produces a versioned Evidence Graph / Canonical IR
+ covering routes, DOM and runtime state, styles, assets, responsive behaviour, interactions,
+ workflows, network contracts, motion, accessibility and product topology. Reconstruction
+ builders consume frozen C0PY specs; they never become the source of truth.
+
+
+
+ API status
+ {api.reachable ? (
+
+
+ {base} answered HTTP {api.httpStatus}: status {api.status}
+
+
+
+ CL0UD binding: {api.cl0ud ?? "not reported"} · API time: {api.timestamp ?? "not reported"} · read at{" "}
+ {api.checkedAt}
+
+
+ ) : (
+
+
+ {base} could not be read ({api.reason}
+ {api.httpStatus ? `, HTTP ${api.httpStatus}` : ""}).
+
+
+
+ This console reports what it measured at {api.checkedAt}; it does not invent a status.
+
+
+ )}
+
+
+
+ API surface
+
+ The routes the C0PY API serves today. Everything except /health requires a bearer
+ token; this console never asks for one and never stores one.
+
+
+
+
+ Method
+ Path
+ Access
+ Purpose
+
+
+
+ {API_SURFACE.map((route) => (
+
+ {route.method}
+ {route.path}
+ {route.auth}
+ {route.purpose}
+
+ ))}
+
+
+
+
+
+ Canonical pipeline
+
+ {PIPELINE.map((step) => (
+ {step}
+ ))}
+
+
+
+
+ C0PY web · own liveness at /api/health · API liveness at{" "}
+ {base}/health
+
+
+ >
+ );
}
diff --git a/apps/web/src/lib/api-status.ts b/apps/web/src/lib/api-status.ts
new file mode 100644
index 0000000..9454a2d
--- /dev/null
+++ b/apps/web/src/lib/api-status.ts
@@ -0,0 +1,86 @@
+/**
+ * Live status for the C0PY API, read from the API's own public /health route.
+ *
+ * Honesty rule (docs/STANDARDS.md): the console never renders an invented
+ * status. If the API cannot be reached, that is what the UI says.
+ */
+export type ApiStatus =
+ | {
+ reachable: true;
+ httpStatus: number;
+ status: string;
+ timestamp: string | null;
+ cl0ud: string | null;
+ checkedAt: string;
+ }
+ | {
+ reachable: false;
+ httpStatus: number | null;
+ reason: string;
+ checkedAt: string;
+ };
+
+export const DEFAULT_API_BASE_URL = "https://c0py-api.siax.io";
+
+export function apiBaseUrl(env: Record = process.env): string {
+ const raw = env.C0PY_API_BASE_URL?.trim();
+ return (raw && raw.length > 0 ? raw : DEFAULT_API_BASE_URL).replace(/\/+$/, "");
+}
+
+export async function fetchApiStatus(
+ baseUrl: string,
+ fetchImpl: typeof fetch = fetch,
+ timeoutMs = 4000,
+): Promise {
+ const checkedAt = new Date().toISOString();
+ const controller = new AbortController();
+ const timer = setTimeout(() => controller.abort(), timeoutMs);
+ try {
+ const res = await fetchImpl(`${baseUrl}/health`, {
+ cache: "no-store",
+ signal: controller.signal,
+ headers: { accept: "application/json" },
+ });
+ if (!res.ok) {
+ return { reachable: false, httpStatus: res.status, reason: `API /health answered HTTP ${res.status}`, checkedAt };
+ }
+ const body: unknown = await res.json();
+ const obj = (body ?? {}) as Record;
+ return {
+ reachable: true,
+ httpStatus: res.status,
+ status: typeof obj.status === "string" ? obj.status : "unknown",
+ timestamp: typeof obj.timestamp === "string" ? obj.timestamp : null,
+ cl0ud: typeof obj.cl0ud === "string" ? obj.cl0ud : null,
+ checkedAt,
+ };
+ } catch (error) {
+ const reason = error instanceof Error ? error.name === "AbortError" ? `no answer within ${timeoutMs} ms` : error.message : "unknown error";
+ return { reachable: false, httpStatus: null, reason, checkedAt };
+ } finally {
+ clearTimeout(timer);
+ }
+}
+
+/** The routes the API actually serves today (apps/api/src). */
+export const API_SURFACE: ReadonlyArray<{ method: string; path: string; auth: "public" | "bearer"; purpose: string }> = [
+ { method: "GET", path: "/health", auth: "public", purpose: "Liveness and CL0UD binding mode" },
+ { method: "GET", path: "/v1/c0py/registries", auth: "bearer", purpose: "Registered capture registries" },
+ { method: "GET", path: "/v1/c0py/registries/:id", auth: "bearer", purpose: "One registry and its provenance" },
+ { method: "GET", path: "/v1/c0py/scans", auth: "bearer", purpose: "Capture/scan runs" },
+ { method: "GET", path: "/v1/c0py/scans/:id", auth: "bearer", purpose: "One run, its evidence and fidelity" },
+];
+
+/** The canonical pipeline, as declared in README.md / docs/MASTERPLAN.md. */
+export const PIPELINE: ReadonlyArray = [
+ "Source product",
+ "discovery",
+ "Playwright/CDP deterministic capture",
+ "semantic workflow exploration",
+ "Evidence Graph / Canonical IR",
+ "frozen reconstruction specs",
+ "builders (v0 / Lovable / Codex / generic)",
+ "preview deployment",
+ "multidimensional QA",
+ "typed repair loop",
+];
diff --git a/apps/web/tests/api-status.test.ts b/apps/web/tests/api-status.test.ts
new file mode 100644
index 0000000..b7d750d
--- /dev/null
+++ b/apps/web/tests/api-status.test.ts
@@ -0,0 +1,70 @@
+import { describe, expect, it } from "vitest";
+import {
+ API_SURFACE,
+ DEFAULT_API_BASE_URL,
+ PIPELINE,
+ apiBaseUrl,
+ fetchApiStatus,
+} from "../src/lib/api-status";
+
+function jsonResponse(body: unknown, status = 200): Response {
+ return new Response(JSON.stringify(body), { status, headers: { "content-type": "application/json" } });
+}
+
+describe("apiBaseUrl", () => {
+ it("falls back to the canonical API host", () => {
+ expect(apiBaseUrl({})).toBe(DEFAULT_API_BASE_URL);
+ });
+
+ it("uses the configured base URL and strips trailing slashes", () => {
+ expect(apiBaseUrl({ C0PY_API_BASE_URL: "https://c0py-api.example.test/" })).toBe(
+ "https://c0py-api.example.test",
+ );
+ });
+});
+
+describe("fetchApiStatus", () => {
+ it("reports the status the API actually returned", async () => {
+ const result = await fetchApiStatus("https://api.test", async (input) => {
+ expect(String(input)).toBe("https://api.test/health");
+ return jsonResponse({ status: "ok", timestamp: "2026-11-11T00:00:00.000Z", cl0ud: "disabled" });
+ });
+ expect(result.reachable).toBe(true);
+ if (!result.reachable) throw new Error("expected reachable");
+ expect(result.status).toBe("ok");
+ expect(result.cl0ud).toBe("disabled");
+ expect(result.timestamp).toBe("2026-11-11T00:00:00.000Z");
+ });
+
+ it("does not invent a status when the API answers an error code", async () => {
+ const result = await fetchApiStatus("https://api.test", async () => jsonResponse({}, 503));
+ expect(result.reachable).toBe(false);
+ if (result.reachable) throw new Error("expected unreachable");
+ expect(result.httpStatus).toBe(503);
+ expect(result.reason).toContain("503");
+ });
+
+ it("does not invent a status when the API cannot be reached", async () => {
+ const result = await fetchApiStatus("https://api.test", async () => {
+ throw new Error("getaddrinfo ENOTFOUND api.test");
+ });
+ expect(result.reachable).toBe(false);
+ if (result.reachable) throw new Error("expected unreachable");
+ expect(result.reason).toContain("ENOTFOUND");
+ });
+});
+
+describe("declared product surface", () => {
+ it("documents the public health route and the bearer-only v1 routes", () => {
+ expect(API_SURFACE.find((r) => r.path === "/health")?.auth).toBe("public");
+ const v1 = API_SURFACE.filter((r) => r.path.startsWith("/v1/c0py/"));
+ expect(v1.length).toBeGreaterThanOrEqual(4);
+ expect(v1.every((r) => r.auth === "bearer")).toBe(true);
+ });
+
+ it("keeps the canonical pipeline from the masterplan", () => {
+ expect(PIPELINE[0]).toBe("Source product");
+ expect(PIPELINE).toContain("Evidence Graph / Canonical IR");
+ expect(PIPELINE.at(-1)).toBe("typed repair loop");
+ });
+});
diff --git a/apps/web/tests/noop.test.ts b/apps/web/tests/noop.test.ts
deleted file mode 100644
index 363f7cf..0000000
--- a/apps/web/tests/noop.test.ts
+++ /dev/null
@@ -1,7 +0,0 @@
-import { describe, it, expect } from "vitest";
-
-describe("noop", () => {
- it("passes", () => {
- expect(true).toBe(true);
- });
-});