Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion apps/web/app/[locale]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default async function LocaleLayout({
</div>
</header>
<div id="workspace-content" className="studio-content">{children}</div>
<footer className="studio-footer"><span>EvoForge</span><p>{tLayout('footer')}</p></footer>
<footer className="studio-footer"><span>EvoForge</span><p>{tLayout('footer')}</p><details className="studio-footer-costs"><summary>{tLayout('footer-costs-title')}</summary><p>{tLayout('footer-costs')}</p></details></footer>
</div>
</div>
</NextIntlClientProvider>
Expand Down
2 changes: 2 additions & 0 deletions apps/web/app/[locale]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ import {
import { StudioOverview } from "../../components/StudioOverview";
import { CanvasWorkspace } from "../../components/CanvasWorkspace";
import { PromptBar } from "../../components/PromptBar";
import { WelcomeHero } from "../../components/WelcomeHero";
import { SandboxedPreview } from "../../components/SandboxedPreview";

const TERMINAL: MissionState[] = ["PR_OPENED", "CANCELLED", "FAILED"];
Expand Down Expand Up @@ -1196,6 +1197,7 @@ export default function MissionControl() {
renderPreview={(html, title) => <SandboxedPreview html={html} title={title}/>}
overview={<StudioOverview running={wsRunning} runId={displayedArena?.arena_id} measured={arenaSummary?.equal_tools?.scored ?? null} verified={dashboard?.validated_improvements ?? null} participants={participants?.status === 'available' ? participants.participants.length : null} participantsMore={participants?.has_more} heldout={arenaSummary?.equal_tools?.heldout?.evoforge ?? null} singleHeldout={arenaSummary?.equal_tools?.heldout?.single ?? null} wins={arenaSummary?.equal_tools?.wins ?? null} signP={arenaSummary?.equal_tools?.stats?.sign_test_p ?? null} value={arenaSummary?.equal_tools?.value ?? null}/>}
management={management}
welcome={(close) => <WelcomeHero summary={arenaSummary} onClose={close}/>}
composer={<PromptBar disabled={wsRunning} followUpArena={wsFollowUp} onStarted={(id) => { setArenaPendingId(id); setArenaPollError(false); }}/>} />
);
}
33 changes: 30 additions & 3 deletions apps/web/app/[locale]/verify/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,33 @@ export default function VerifyPage({ params }: { params: Promise<{ id: string }>
const sealedKinds = (cert.sealed_kinds ?? []).join(", ");
const heldoutGate = (cert.gates ?? []).find((g) => /heldout|sealed/i.test(g.gate));

const verified = cert.verdict === "VERIFIED";
const gates = cert.gates ?? [];
const gatesPassed = gates.filter((g) => g.result === "PASS").length;
const checks: { ok: boolean | null; label: string }[] = [
{ ok: cert.verify ? !!cert.verify.ok : null, label: t("check-signature") },
{ ok: keyMatches, label: t("check-key") },
{ ok: gates.length > 0 ? gatesPassed === gates.length : null, label: t("check-gates", { passed: gatesPassed, total: gates.length }) },
];

return (
<div className="studio-light max-w-3xl space-y-4">
<h1 className="text-2xl font-bold text-text-primary">{t("heading")} <span className={`text-xs font-semibold px-2.5 py-0.5 rounded-full border ${cert.verdict === "VERIFIED" ? "bg-emerald-50 text-emerald-700 border-emerald-200" : "bg-red-50 text-red-700 border-red-200"}`}>{cert.verdict}</span></h1>
<p className="text-sm text-text-secondary">{t("description")}</p>
<div className="studio-light verify-page max-w-3xl space-y-4">
<section className={`verify-hero${verified ? " is-verified" : " is-failed"}`}>
<span className="verify-badge" aria-hidden="true">{verified ? "✓" : "!"}</span>
<p className="verify-kicker">{t("heading")} · {cert.verdict}</p>
<h1>{verified ? t("hero-verified") : t("hero-failed")}</h1>
<p className="verify-sub">{t("description")}</p>
<ul className="verify-checks">
{checks.map((c) => (
<li key={c.label} className={c.ok === null ? "is-unknown" : c.ok ? "is-ok" : "is-bad"}>
<span aria-hidden="true">{c.ok === null ? "–" : c.ok ? "✓" : "✕"}</span>
{c.label}
</li>
))}
</ul>
</section>
<details className="perf-section verify-details">
<summary>{t("details")}</summary>
<Card className="bg-background-secondary border border-border">
{cert.signed ? (
<p className="text-sm text-text-primary">
Expand Down Expand Up @@ -88,6 +111,9 @@ export default function VerifyPage({ params }: { params: Promise<{ id: string }>
) : null}
</dl>
</Card>
</details>
<details className="perf-section verify-details">
<summary>{t("gates")} · {t("chain")}</summary>
<Card className="bg-background-secondary border border-border">
<h3 className="text-base font-semibold m-0 text-text-primary">{t("gates")}</h3>
{(cert.gates ?? []).map((g) => (
Expand All @@ -98,6 +124,7 @@ export default function VerifyPage({ params }: { params: Promise<{ id: string }>
<div key={c.stage} className="text-sm text-text-primary">{c.stage}: {c.event_id ?? "—"}</div>
))}
</Card>
</details>
</div>
);
}
14 changes: 14 additions & 0 deletions apps/web/components/CanvasWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,12 @@ type Props = {
management: ReactNode;
composer: ReactNode;
renderPreview: (html: string, title: string) => ReactNode;
// First-visit introduction; shown until dismissed once, reopened from the toolbar.
welcome?: (close: () => void) => ReactNode;
};

const WELCOME_KEY = 'evoforge.welcome.seen';

export function CanvasWorkspace(props: Props) {
const t = useTranslations('canvas');
const ts = useTranslations('studio');
Expand All @@ -46,6 +50,14 @@ export function CanvasWorkspace(props: Props) {
const [compare, setCompare] = useState(true);
const [panel, setPanel] = useState<Panel>(null);
const [copied, setCopied] = useState(false);
const [welcome, setWelcome] = useState(false);
useEffect(() => {
try { if (!window.localStorage.getItem(WELCOME_KEY)) setWelcome(true); } catch { setWelcome(true); }
}, []);
const closeWelcome = () => {
setWelcome(false);
try { window.localStorage.setItem(WELCOME_KEY, '1'); } catch {}
};
const dialog = useRef<HTMLDialogElement>(null);
const mobileMenu = useRef<HTMLDetailsElement>(null);
const returnFocus = useRef<HTMLElement | null>(null);
Expand Down Expand Up @@ -101,6 +113,7 @@ export function CanvasWorkspace(props: Props) {
<span className={`canvas-record${props.busy ? ' is-running' : ''}`} role="status">{t(props.busy ? props.doc ? 'running' : 'received' : props.doc ? 'recorded' : 'waiting')}</span>
</div>
<div className="canvas-toolbar-actions">
{props.welcome && iconButton('spark', t('about'), () => setWelcome(true))}
{iconButton('users', t('activity'), () => setPanel('activity'))}
{iconButton('history', t('history'), () => setPanel('history'))}
<div className="canvas-desktop-actions">{iconButton('performance', t('metrics'), () => setPanel('metrics'))}{iconButton('settings', t('settings'), () => setPanel('admin'))}</div>
Expand Down Expand Up @@ -148,6 +161,7 @@ export function CanvasWorkspace(props: Props) {
</article>;
})}
</section>
{welcome && props.welcome?.(closeWelcome)}
{props.pollError && <div className="canvas-feedback" role="alert"><span>{t('load-failed')}</span><button type="button" onClick={props.onRetry}>{t('retry')}</button></div>}
{props.composer}
<dialog ref={dialog} className="canvas-inspector" aria-labelledby="canvas-inspector-title" onCancel={event => {event.preventDefault(); setPanel(null);}} onClick={event => {
Expand Down
2 changes: 1 addition & 1 deletion apps/web/components/FeatureRail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export function FeatureRail() {
document.addEventListener('keydown', close);
return () => document.removeEventListener('keydown', close);
}, [moreOpen, mobileOpen]);
const link = ({path, key, icon}: {path: string; key: string; icon: string}) => <a key={path} href={`${prefix}${path}`} title={t(key)} aria-label={t(key)} data-tooltip={t(key)} aria-current={routePath === path ? 'page' : undefined} className={`canvas-rail-link${routePath === path ? ' is-active' : ''}`}><StudioIcon name={icon}/><span className="sr-only">{t(key)}</span></a>;
const link = ({path, key, icon}: {path: string; key: string; icon: string}) => <a key={path} href={`${prefix}${path}`} title={t(key)} aria-label={t(key)} data-tooltip={t(key)} aria-current={routePath === path ? 'page' : undefined} className={`canvas-rail-link${routePath === path ? ' is-active' : ''}`}><StudioIcon name={icon}/><span className="canvas-rail-label">{t(key)}</span></a>;
const content = <>
<a href={prefix || '/'} className="canvas-rail-brand" title="EvoForge" aria-label="EvoForge"><StudioMark/></a>
<div className="canvas-rail-items">{ITEMS.map(link)}</div>
Expand Down
72 changes: 72 additions & 0 deletions apps/web/components/WelcomeHero.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
'use client';

import { useLocale, useTranslations } from 'next-intl';
import type { ArenaSummary } from '../lib/api';
import { StudioIcon } from './StudioIcon';

// First-visit introduction over the canvas: what EvoForge is, how a run works and what the measured
// record says, with the numbers read from the arena summary (never typed in).
export function WelcomeHero({ summary, onClose }: { summary: ArenaSummary | null; onClose: () => void }) {
const t = useTranslations('welcome');
const tw = useTranslations('workspace');
const locale = useLocale();
const prefix = locale === 'en' ? '' : `/${locale}`;
const eq = summary?.equal_tools;
const share = (h?: { passed: number; n: number }) => (h && h.n > 0 ? Math.round((100 * h.passed) / h.n) : null);
const evoShare = share(eq?.heldout?.evoforge);
const singleShare = share(eq?.heldout?.single);
const tryIt = () => {
onClose();
// The composer lives at the bottom of the canvas; put the cursor there.
setTimeout(() => document.querySelector<HTMLTextAreaElement>('.studio-composer textarea')?.focus(), 50);
};
const steps = [
{ title: t('step-1'), body: tw('intro-step-1') },
{ title: t('step-2'), body: tw('intro-step-2') },
{ title: t('step-3'), body: tw('intro-step-3') },
];
return (
<div className="welcome-layer" role="dialog" aria-modal="false" aria-labelledby="welcome-title">
<section className="welcome-card">
<button type="button" className="welcome-close" onClick={onClose} aria-label={t('close')} title={t('close')}>
<StudioIcon name="close" width="18" height="18" />
</button>
<span className="welcome-eyebrow"><StudioIcon name="spark" width="14" height="14" />{t('eyebrow')}</span>
<h1 id="welcome-title">{t('title')}</h1>
<p className="welcome-sub">{tw('intro')}</p>
<ol className="welcome-steps">
{steps.map((step, i) => (
<li key={step.title}>
<span className="welcome-step-n">{i + 1}</span>
<strong>{step.title}</strong>
<p>{step.body}</p>
</li>
))}
</ol>
{eq && (eq.scored ?? 0) > 0 && (
<dl className="welcome-stats">
<div>
<dt>{t('stat-record', { n: eq.scored })}</dt>
<dd>{eq.wins?.evoforge ?? 0}<span> {t('stat-wins')}</span> · {eq.wins?.single ?? 0}<span> {t('stat-losses')}</span></dd>
</div>
{evoShare !== null && singleShare !== null && (
<div>
<dt>{t('stat-hidden')}</dt>
<dd>{evoShare}%<span> vs {singleShare}%</span></dd>
</div>
)}
<div>
<dt>{t('stat-signed')}</dt>
<dd>Ed25519</dd>
</div>
</dl>
)}
<div className="welcome-actions">
<button type="button" className="welcome-primary" onClick={tryIt}>{t('cta-try')}</button>
<button type="button" className="welcome-secondary" onClick={onClose}>{t('cta-watch')}</button>
<a className="welcome-link" href={`${prefix}/arena`}>{t('cta-scoreboard')} <StudioIcon name="arrow" width="14" height="14" /></a>
</div>
</section>
</div>
);
}
31 changes: 28 additions & 3 deletions apps/web/messages/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"readonly": "Run access required",
"readonly-short": "Read only",
"no-patch": "No patch produced — scored 0",
"patch-not-applied": "Patch did not apply — scored 0"
"patch-not-applied": "Patch did not apply — scored 0",
"about": "What is EvoForge?"
},
"share": {
"button": "Share",
Expand Down Expand Up @@ -567,7 +568,13 @@
"verify-label": "Verify",
"diff-label": "Diff SHA256",
"sealed-label": "Sealed tests",
"sealed-value": "{count} ({kinds})"
"sealed-value": "{count} ({kinds})",
"hero-verified": "This result is verified",
"hero-failed": "This result could not be verified",
"check-signature": "The signature over this result is valid",
"check-key": "It was signed with this server's published key",
"check-gates": "{passed} of {total} release gates passed",
"details": "Certificate details"
},
"leaderboard": {
"heading": "Trust leaderboard",
Expand All @@ -591,7 +598,9 @@
"layout": {
"title": "EvoForge — Mission Control",
"description": "Verified code improvement service: generate → gate → review → PR → evidence.",
"footer": "Builder: Muse Spark 1.3 via Meta Model API · Gates: integrity gate (oracle_ast + provisional test-strength check) · costs are provider_billed actuals in cents from GET /v1/ledger; UNKNOWN holds listed separately"
"footer": "Built with Muse Spark 1.3 on the Meta Model API. Hidden tests decide every result, each result is signed with Ed25519, and costs come from the provider-billed ledger.",
"footer-costs-title": "How costs are counted",
"footer-costs": "Costs are provider_billed actuals in cents from GET /v1/ledger; UNKNOWN holds are listed separately."
},
"errors": {
"budget-exhausted": "Budget exhausted: mission step refused with 402",
Expand Down Expand Up @@ -808,5 +817,21 @@
"evolution": "Autopilot",
"leaderboard": "Trust leaderboard",
"share": "Shared result"
},
"welcome": {
"eyebrow": "Built on Muse Spark 1.3 · Meta Model API",
"title": "AI code you can verify, not just trust.",
"step-1": "You ask",
"step-2": "Same model, built twice",
"step-3": "Hidden tests decide",
"stat-record": "Fair matches ({n} scored)",
"stat-wins": "won",
"stat-losses": "lost",
"stat-hidden": "Hidden tests passed",
"stat-signed": "Every result is signed",
"cta-try": "Try it yourself",
"cta-watch": "See a recorded match",
"cta-scoreboard": "Full scoreboard",
"close": "Close"
}
}
31 changes: 28 additions & 3 deletions apps/web/messages/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@
"readonly": "실행 권한 필요",
"readonly-short": "보기 전용",
"no-patch": "패치를 만들지 못함 — 0점 처리",
"patch-not-applied": "패치가 적용되지 않음 — 0점 처리"
"patch-not-applied": "패치가 적용되지 않음 — 0점 처리",
"about": "EvoForge란?"
},
"share": {
"button": "공유",
Expand Down Expand Up @@ -567,7 +568,13 @@
"verify-label": "검증",
"diff-label": "Diff SHA256",
"sealed-label": "봉인 테스트",
"sealed-value": "{count} ({kinds})"
"sealed-value": "{count} ({kinds})",
"hero-verified": "검증된 결과예요",
"hero-failed": "검증하지 못한 결과예요",
"check-signature": "이 결과에 대한 서명이 유효해요",
"check-key": "이 서버가 공개한 키로 서명했어요",
"check-gates": "출시 게이트 {total}개 중 {passed}개 통과",
"details": "인증서 세부 정보"
},
"leaderboard": {
"heading": "신뢰 리더보드",
Expand All @@ -591,7 +598,9 @@
"layout": {
"title": "EvoForge — 미션 컨트롤",
"description": "검증된 코드 개선 서비스: 생성 → 게이트 → 리뷰 → PR → 증거.",
"footer": "빌더: Muse Spark 1.3 (Meta Model API 사용) · 게이트: 무결성 게이트 (oracle_ast + 임시 테스트 강도 검사) · 비용은 GET /v1/ledger에서 센트 단위의 provider_billed 실제 값; UNKNOWN 보류는 별도로 나열"
"footer": "Meta Model API의 Muse Spark 1.3으로 만들었어요. 모든 결과는 숨은 테스트가 판정하고 Ed25519로 서명하며, 비용은 실제 청구된 원장 기준이에요.",
"footer-costs-title": "비용 계산 방식",
"footer-costs": "비용은 GET /v1/ledger의 provider_billed 실제 값(센트)이며, UNKNOWN 보류는 따로 표시해요."
},
"errors": {
"budget-exhausted": "예산 소진: 미션 단계가 402로 거부됨",
Expand Down Expand Up @@ -808,5 +817,21 @@
"evolution": "오토파일럿",
"leaderboard": "신뢰 리더보드",
"share": "공유된 결과"
},
"welcome": {
"eyebrow": "Muse Spark 1.3 · Meta Model API 기반",
"title": "믿는 대신, 검증된 AI 코드만 받으세요.",
"step-1": "요청해요",
"step-2": "같은 모델이 두 번 만들어요",
"step-3": "숨은 테스트가 판정해요",
"stat-record": "공정 대결 ({n}판 판정)",
"stat-wins": "승",
"stat-losses": "패",
"stat-hidden": "숨은 테스트 통과율",
"stat-signed": "모든 결과에 서명",
"cta-try": "직접 해 보기",
"cta-watch": "녹화된 대결 보기",
"cta-scoreboard": "전체 점수판",
"close": "닫기"
}
}
Loading
Loading