// Entry detail — full record for one logbook entry. Shown over the Projects grid. // All fields come from the real ledger entry plus a lazy meta/brief/smoke fetch — // see fetchSpecimenDetail() in chrome.jsx. function IoTable({ rows }) { if (!rows || !Object.keys(rows).length) return null; const hasRange = Object.values(rows).some((v) => v.min != null); return (
{hasRange && } {Object.entries(rows).map(([k, v]) => ( {hasRange && } ))}
KeyTypeUnitRangeDescription
{k} {v.type} {v.unit || "—"}{v.min != null ? `${v.min}–${v.max}` : "—"}{v.description}
); } // navigator.clipboard needs a secure context (https, or localhost) — this // site is served over plain http on the LAN, so fall back to the old // execCommand("copy") trick via a hidden textarea when it's unavailable. function copyText(text) { if (navigator.clipboard && window.isSecureContext) { return navigator.clipboard.writeText(text); } return new Promise((resolve, reject) => { const ta = document.createElement("textarea"); ta.value = text; ta.style.position = "fixed"; ta.style.opacity = "0"; document.body.appendChild(ta); ta.focus(); ta.select(); try { document.execCommand("copy"); resolve(); } catch (err) { reject(err); } finally { document.body.removeChild(ta); } }); } function CopyButton({ text }) { const [done, setDone] = React.useState(false); return ( ); } // Machine interface accordion — the `window.somnialApi` contract for this // specimen, callable over HTTP via the server's /api/catalog routes. function MachineInterface({ catalogue, api }) { const defaults = {}; for (const [k, v] of Object.entries(api.inputs || {})) { defaults[k] = "default" in v ? v.default : (v.min != null ? (v.min + (v.max ?? 100)) / 2 : ""); } const curlText = `curl ${location.origin}/api/catalog/${catalogue}/run \\\n -X POST -H "Content-Type: application/json" \\\n -d '${JSON.stringify({ inputs: defaults }, null, 2)}'`; return (
Machine interface — API documentation ▸

POST /api/catalog/{catalogue}/run

{api.description &&

{api.description}

}

Inputs

Outputs

Example

{curlText}
); } // The model writes its reasoning as loose markdown (**bold**, ### headers, // --- rules). Strip that lightly and split on blank lines so it reads as // plain paragraphs, matching the rest of the site's plain-prose style. function mdToParagraphs(raw) { const cleaned = (raw || "") .replace(/\*\*(.*?)\*\*/g, "$1") .replace(/^#{1,6}\s*/gm, "") .replace(/^-{3,}\s*$/gm, "") .trim(); return cleaned.split(/\n{2,}/).map((p) => p.trim()).filter(Boolean); } // Build notes accordion — the editorial reasoning behind tonight's Dynamic/ // Domain/Form pick (the model's own prose, ahead of its JSON brief) plus a // one-line diagnosis for each self-repair attempt, if any were needed. // Distinct from the diary (personal voice) and the raw transcript.json. function BuildNotes({ notes }) { const ideasText = (notes?.ideas || "").trim(); const repairs = notes?.repairs || []; if (!ideasText && !repairs.length) return null; return (
Build notes — reasoning and repairs ▸
{ideasText && (

Why this seed became this brief

{mdToParagraphs(ideasText).map((p, i) => (

{p}

))}
)}

Self-repair

{repairs.length ? ( repairs.map((r) => (

Attempt {r.attempt}. {r.diagnosis}

)) ) : (

Built clean — no repairs needed.

)}
); } function EntryDetail({ entry, total, onClose, onPrev, onNext }) { const { fmtTitle, fmtDate, fmtTime, fetchSpecimenDetail, StatusBadge, isLive } = window; const [detail, setDetail] = React.useState(null); React.useEffect(() => { setDetail(null); fetchSpecimenDetail(entry.catalogue).then(setDetail); }, [entry.catalogue]); React.useEffect(() => { const h = (ev) => { if (ev.key === "Escape") onClose(); if (ev.key === "ArrowLeft") onPrev(); if (ev.key === "ArrowRight") onNext(); }; window.addEventListener("keydown", h); return () => window.removeEventListener("keydown", h); }, [onClose, onPrev, onNext]); const e = entry; const live = isLive(e); const title = fmtTitle(e.tool || e.form) || `Specimen ${e.catalogue}`; // Point at the specimen's own directory, pinned to the commit that logged // it — not the commit diff. The repo is one and the same across pipeline, // portal and every generated specimen; this is the browsable proof that // this entry's files (app, diary, transcript, meta) live there, self- // contained, exactly as published. commit_url is always // "/commit/" (see somnial/github.py:commit_url) so swapping the // path segment is safe and needs no pipeline change or data migration. const sourceHref = e.commit_url ? `${e.commit_url.replace("/commit/", "/tree/")}/catalog/${e.catalogue}` : "https://github.com/0xbadface2000/somnial-workshop"; return (
{e.catalogue}/ {total}

{title}

{live && ( Launch App ↗ )}

{detail?.premise || e.dynamic}

EVIDENCE — published build {live ? "live" : "unavailable"}
{live ? {`${title} { ev.target.style.display = "none"; }} /> : {e.status === "failed" ? "build did not pass — no artifact" : "withheld — not published"}}
{live && detail?.api && } {detail?.notes && }
); } Object.assign(window, { EntryDetail });