Organism · beta · v1.0.0 · owner: Site system lead · contract 19 of 20 points (open: figma)
Do and don't
Do: Full demo
Rendered by agent-check.tsOpen example: The agent's draft, checked · Do: Full demo Use the full-page example to follow page links.
Do: Figure on the landing
Rendered by agent-check.tsOpen example: The agent's draft, checked · Do: Figure on the landing Use the full-page example to follow page links.
Don't: Without the scripted-agent caption
Rendered by agent-check.tsOpen example: The agent's draft, checked · Don't: Without the scripted-agent caption Use the full-page example to follow page links.
Don't: Twice on one page
Rendered by agent-check.tsOpen example: The agent's draft, checked · Don't: Twice on one page Use the full-page example to follow page links.
Rules
| Rule | Why | Check |
|---|---|---|
| The agent's draft, checked is computed by Loom's code from three scripted agent drafts and Loom's real composition check (scripts/site/interactives/agent-check.ts), not drawn by hand. | A showcase is proof only if the product's own code produced what it shows. | Automated: scripts/site/interactives/check.ts (recomputes the showcase data and fails on drift) |
| Each enhanced tab controls its unique local panel and each panel is labelled by its tab; repeated static specimens use distinct explicit instanceKey values. Disposal restores the all-cases readable fallback. | Tabs need programmatic associations as well as keyboard selection, without cross-instance references. | Automated: tests/site/agent-check-tabs.spec.ts; tests/unit/agent-check-tabs.test.ts |
| The caption says the agent is scripted and the findings are real. | Truthfulness: the drafts are fixed, the check is live code. | Automated: site-claims test (agent-check caption) |
API
| Prop | Type | Required | Default | What it does |
|---|---|---|---|---|
instanceKey | string | No | Optional deterministic ID scope for repeated review specimens; distinct keys per static instance. Singleton markup retains its existing IDs; managed mounts also scope cloned roots. | |
lang | en | ja | No | "en" | Interface language; engine output stays English. |
variant | full | figure | No | "full" | Full demo with tabs, or one draft as a figure. |
Contract details
The full contract: identity, anatomy, variants, states, tokens, layout, motion, accessibility, content, tests
Identity
| Aspect | Value |
|---|---|
| Id | agent-check |
| Layer | Organisms |
| Category | showcase |
| Owner | Site system lead |
| Status | beta |
| Version | 1.0.0 |
| Source | apps/showcase/site/system/organisms/agent-check.ts (private repository; the contract and the render function are this one module) |
| Version | Date | Change |
|---|---|---|
| 1.0.0 | 2026-10-26 | The agent's draft, checked: computed by Loom's code from three scripted agent drafts and Loom's real composition check (scripts/site/interactives/agent-check.ts). |
Use when
- Where the page claims Loom checks what agents write. Why: The real findings on real code prove it.
- The landing's problem section, in its figure variant. Why: One draft and its findings make the problem concrete.
Do not use when
- To suggest a live model was called. Why: The agent is scripted; the caption says so.
- More than once on a page. Why: One proof per claim.
Anatomy
| Part | What it is |
|---|---|
| root | div.ix-ac (full) or figure.ix-ac-figure |
| tabs | Three labelled native draft tabs linked by aria-controls to their case panels; enhanced panels are labelled by their actual tab |
| code | Numbered lines, marked where a finding points |
| findings | Finding molecules with severity words |
| caption | Scripted example; findings are real output |
Made of: showcase-frame, finding, code-block, control, caption.
Used in: pages directly.
Variants
| Variant | When | Why |
|---|---|---|
| full | Its demo page and the Run section. | All three drafts and the fix. |
| figure | The landing's problem section. | One draft is enough to show the problem. |
States
| State | Rendered or not applicable |
|---|---|
| default | Full variant keeps all scripted drafts/findings readable until enhancement; figure variant is a static single draft with the scripted-source caption. |
| hover | Full-variant native tabs/finding buttons use their hover affordances; figure content does not acquire playback controls. |
| focus-visible | Full tabs show focus; activating a finding intentionally focuses and scrolls its actual source line. Figure variant has no tab controls. |
| active | Full variant selects a draft or marks a finding/code line; no Play/Pause sequence exists. |
| disabled | Not applicable: The authored draft tabs/findings have no disabled state; unavailable line targets are not fabricated. |
| loading | Full variant remains readable while its managed optional chunk loads; validated initialization reveals its tablist. Figure variant is complete build-time content. |
| empty | Not applicable: Build-time scripted cases/findings are required; no empty-data API is exposed. |
| error | Full-variant caught chunk/init failure restores readable static cases and hidden enhancement tabs; the host records failure and remount may retry. The figure has no managed task to fail. |
| current | aria-selected identifies the chosen full draft tab; aria-pressed and is-active identify a selected finding/line. |
| visited | Not applicable: No visited state on this root; any contained native links retain their own browser history. |
| expanded | Not applicable: No disclosure state on this root; replacing a view is not aria-expanded. |
Tokens
| Part | Token |
|---|---|
| line.marked | --ix-wait (saffron ink) |
| line.active | --ix-broken (madder ink) |
| findings.rule | --rule in the finding's state colour |
| root.font | --font-mono for code |
| --agent-check-ix-ok-teal-ink | var(--teal-ink) |
| --agent-check-ix-wait-saffron-ink | var(--saffron-ink) |
| --agent-check-ix-broken-madder-ink | var(--madder-ink) |
| --agent-check-ix-action-indigo-ink | var(--indigo-ink) |
| --agent-check-ix-ink-ink | var(--ink) |
| --agent-check-ix-ink-2-ink-2 | var(--ink-2) |
| --agent-check-ix-line-line | var(--line) |
| --agent-check-ix-surface-surface | var(--surface) |
| --agent-check-ix-ground-cotton | var(--cotton) |
| --agent-check-padding-space-6 | var(--space-6) |
| --agent-check-padding-space-8 | var(--space-8) |
| --agent-check-margin-space-8 | var(--space-8) |
| --agent-check-margin-space-5 | var(--space-5) |
| --agent-check-font-type-label | var(--type-label) |
| --agent-check-padding-space-2 | var(--space-2) |
| --agent-check-padding-space-4 | var(--space-4) |
| --agent-check-gap-space-4 | var(--space-4) |
| --agent-check-margin-bottom-space-6 | var(--space-6) |
| --agent-check-font-type-small-strong | var(--type-small-strong) |
| --agent-check-outline-focus | var(--focus) |
| --agent-check-margin-bottom-space-7 | var(--space-7) |
| --agent-check-font-type-strong | var(--type-strong) |
| --agent-check-margin-space-2 | var(--space-2) |
| --agent-check-gap-space-6 | var(--space-6) |
| --agent-check-gap-space-8 | var(--space-8) |
| --agent-check-margin-space-3 | var(--space-3) |
| --agent-check-font-size-fs-small | var(--fs-small) |
| --agent-check-padding-space-5 | var(--space-5) |
| --agent-check-background-surface-2 | var(--surface-2) |
| --agent-check-padding-right-space-5 | var(--space-5) |
| --agent-check-border-top-rule | var(--rule) |
| --agent-check-padding-top-space-3 | var(--space-3) |
| --agent-check-gap-space-1 | var(--space-1) |
| --agent-check-margin-space-1 | var(--space-1) |
| --agent-check-margin-top-space-5 | var(--space-5) |
| --agent-check-margin-space-4 | var(--space-4) |
| --agent-check-gap-space-3 | var(--space-3) |
Layout
| Aspect | Value |
|---|---|
| breakpoints | Required review at 390, 768, 1024 and 1440 px; execution is not implied by this declaration; columns stack under 768 px and controls fill the row on phones. |
| wrapping | Text wraps; code panes scroll inside their own focusable region. |
| textExpansion | Japanese strings come from the i18n tables and wrap; engine output stays English. |
Spacing and rhythm
| Aspect | Value |
|---|---|
| internal | Inside the Showcase frame's padding, controls and caption at its foot. |
| external | Full width of its section. |
| rhythm | One showcase per section, after the section's claim (D-SITE-008). |
Motion
| Aspect | Value |
|---|---|
| None | Manual case changes and finding-to-line focus/scroll; no intrinsic timed animation or autoplay. |
Runtime and reuse
stylesheet: /css/site.css. Built Site tokens, core and registered element CSS; preserve modes, focus and responsive rules.
stylesheet: /css/demos.css. Existing legacy demo styles where the rendered specimen uses them.
font: /fonts/. Self-hosted files referenced by Site @font-face, with licences; Japanese locale overrides remain applicable.
Static fallback: Original build-time specimen remains readable before loading and after chunk/initialization failure; enhancement controls retain authored hidden state.
Configured initializer: apps/showcase/site/interactives/agent-check.ts#init. The host owns transactional static-markup restoration and runtime state.
Consumer module (imports relative to the configured source root): import { createRuntimeHost } from "./src/workflows/runtime-host"; import { SITE_RUNTIMES } from "./apps/showcase/site/runtime-registry"; const definition = SITE_RUNTIMES.find(entry => entry.binding.id === "agent-check"); if (!definition || definition.binding.lifecycle.kind !== "managed") throw new Error("Managed runtime binding unavailable"); const host = createRuntimeHost([definition]); export function mountRuntime(container: ParentNode) { return host.mountAll(container); }After inserting the rendered markup, call mountRuntime(container) for the container holding [data-demo="agent-check"]. Retain the returned disposal function and call it before removing, replacing or remounting, including every Storybook args render. The configured host restores captured static markup/attributes on disposal or caught load/initialization failure; retry starts a fresh managed remount.
Accessibility passport
| Aspect | Value |
|---|---|
| role | region with a heading, or a figure |
| name | Its heading or caption |
| keyboard | Full draft tabs use Left/Right/Home/End; findings use native Enter/Space to focus the referenced code line. Figure content is static. |
| focus | Keyboard tab selection focuses its tab; activating a finding focuses the actual referenced source line. |
| screenReader | After enhancement each tab controls one labelled tabpanel; before enhancement all sections retain their heading names. Selected draft, finding severity/message and code line are named; the caption explicitly says the agent is scripted, not a live model. |
| contrast | Ink on surface 14:1; state dyes only as marks with words. |
| target | Controls are 44 px. |
Content
| Slot | Length | Voice |
|---|---|---|
| caption | 2 sentences | Scripted example; the findings are the real output of Loom's check |
Good: “Scripted example: no model was called. The findings are the real output of Loom's check on Loom Base.”
Bad: “Our AI catches every bug.”
Japanese: Interface strings in i18n.ts (ix.ac.*); findings stay English with 「チェック結果は英語で表示されます」.
Icons and illustrations
None: this element uses no icon or illustration of its own.
Decisions and exceptions
Usage
1120 uses across the built pages (measured by npm run site:system).
Tests
| Aspect | Value |
|---|---|
| unit | tests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns |
| visual | Not yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts |
| a11y | tests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark |
| parity | scripts/site/system/check.ts: Library examples are rendered by the same render function the site imports |
Figma
not-yet: The Loom Site Figma library is the last stage of the plan; this element is not mapped yet.