The agent's draft, checked

Shows what Loom's check finds in code an agent wrote, line by line, and what is left after the fix: the product's core loop in one view.

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.ts

Open example: The agent's draft, checked · Do: Full demo Use the full-page example to follow page links.

The whole loop: draft, findings, fix.

Do: Figure on the landing

Rendered by agent-check.ts

Open example: The agent's draft, checked · Do: Figure on the landing Use the full-page example to follow page links.

One draft makes the problem concrete.

Don't: Without the scripted-agent caption

Rendered by agent-check.ts

Open example: The agent's draft, checked · Don't: Without the scripted-agent caption Use the full-page example to follow page links.

Readers would think a live model ran.

Don't: Twice on one page

Rendered by agent-check.ts

Open example: The agent's draft, checked · Don't: Twice on one page Use the full-page example to follow page links.

One proof per claim.

Rules

RuleWhyCheck
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

PropTypeRequiredDefaultWhat it does
instanceKeystringNoOptional deterministic ID scope for repeated review specimens; distinct keys per static instance. Singleton markup retains its existing IDs; managed mounts also scope cloned roots.
langen | jaNo"en"Interface language; engine output stays English.
variantfull | figureNo"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

AspectValue
Idagent-check
LayerOrganisms
Categoryshowcase
OwnerSite system lead
Statusbeta
Version1.0.0
Sourceapps/showcase/site/system/organisms/agent-check.ts (private repository; the contract and the render function are this one module)
VersionDateChange
1.0.02026-10-26The 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

PartWhat it is
rootdiv.ix-ac (full) or figure.ix-ac-figure
tabsThree labelled native draft tabs linked by aria-controls to their case panels; enhanced panels are labelled by their actual tab
codeNumbered lines, marked where a finding points
findingsFinding molecules with severity words
captionScripted example; findings are real output

Made of: showcase-frame, finding, code-block, control, caption.

Used in: pages directly.

Variants

VariantWhenWhy
fullIts demo page and the Run section.All three drafts and the fix.
figureThe landing's problem section.One draft is enough to show the problem.

States

StateRendered or not applicable
defaultFull variant keeps all scripted drafts/findings readable until enhancement; figure variant is a static single draft with the scripted-source caption.
hoverFull-variant native tabs/finding buttons use their hover affordances; figure content does not acquire playback controls.
focus-visibleFull tabs show focus; activating a finding intentionally focuses and scrolls its actual source line. Figure variant has no tab controls.
activeFull variant selects a draft or marks a finding/code line; no Play/Pause sequence exists.
disabledNot applicable: The authored draft tabs/findings have no disabled state; unavailable line targets are not fabricated.
loadingFull variant remains readable while its managed optional chunk loads; validated initialization reveals its tablist. Figure variant is complete build-time content.
emptyNot applicable: Build-time scripted cases/findings are required; no empty-data API is exposed.
errorFull-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.
currentaria-selected identifies the chosen full draft tab; aria-pressed and is-active identify a selected finding/line.
visitedNot applicable: No visited state on this root; any contained native links retain their own browser history.
expandedNot applicable: No disclosure state on this root; replacing a view is not aria-expanded.

Tokens

PartToken
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-inkvar(--teal-ink)
--agent-check-ix-wait-saffron-inkvar(--saffron-ink)
--agent-check-ix-broken-madder-inkvar(--madder-ink)
--agent-check-ix-action-indigo-inkvar(--indigo-ink)
--agent-check-ix-ink-inkvar(--ink)
--agent-check-ix-ink-2-ink-2var(--ink-2)
--agent-check-ix-line-linevar(--line)
--agent-check-ix-surface-surfacevar(--surface)
--agent-check-ix-ground-cottonvar(--cotton)
--agent-check-padding-space-6var(--space-6)
--agent-check-padding-space-8var(--space-8)
--agent-check-margin-space-8var(--space-8)
--agent-check-margin-space-5var(--space-5)
--agent-check-font-type-labelvar(--type-label)
--agent-check-padding-space-2var(--space-2)
--agent-check-padding-space-4var(--space-4)
--agent-check-gap-space-4var(--space-4)
--agent-check-margin-bottom-space-6var(--space-6)
--agent-check-font-type-small-strongvar(--type-small-strong)
--agent-check-outline-focusvar(--focus)
--agent-check-margin-bottom-space-7var(--space-7)
--agent-check-font-type-strongvar(--type-strong)
--agent-check-margin-space-2var(--space-2)
--agent-check-gap-space-6var(--space-6)
--agent-check-gap-space-8var(--space-8)
--agent-check-margin-space-3var(--space-3)
--agent-check-font-size-fs-smallvar(--fs-small)
--agent-check-padding-space-5var(--space-5)
--agent-check-background-surface-2var(--surface-2)
--agent-check-padding-right-space-5var(--space-5)
--agent-check-border-top-rulevar(--rule)
--agent-check-padding-top-space-3var(--space-3)
--agent-check-gap-space-1var(--space-1)
--agent-check-margin-space-1var(--space-1)
--agent-check-margin-top-space-5var(--space-5)
--agent-check-margin-space-4var(--space-4)
--agent-check-gap-space-3var(--space-3)

Layout

AspectValue
breakpointsRequired 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.
wrappingText wraps; code panes scroll inside their own focusable region.
textExpansionJapanese strings come from the i18n tables and wrap; engine output stays English.

Spacing and rhythm

AspectValue
internalInside the Showcase frame's padding, controls and caption at its foot.
externalFull width of its section.
rhythmOne showcase per section, after the section's claim (D-SITE-008).

Motion

AspectValue
NoneManual case changes and finding-to-line focus/scroll; no intrinsic timed animation or autoplay.

Runtime and reuse

  1. stylesheet: /css/site.css. Built Site tokens, core and registered element CSS; preserve modes, focus and responsive rules.

  2. stylesheet: /css/demos.css. Existing legacy demo styles where the rendered specimen uses them.

  3. font: /fonts/. Self-hosted files referenced by Site @font-face, with licences; Japanese locale overrides remain applicable.

  4. Static fallback: Original build-time specimen remains readable before loading and after chunk/initialization failure; enhancement controls retain authored hidden state.

  5. Configured initializer: apps/showcase/site/interactives/agent-check.ts#init. The host owns transactional static-markup restoration and runtime state.

  6. 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); }
  7. 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

AspectValue
roleregion with a heading, or a figure
nameIts heading or caption
keyboardFull draft tabs use Left/Right/Home/End; findings use native Enter/Space to focus the referenced code line. Figure content is static.
focusKeyboard tab selection focuses its tab; activating a finding focuses the actual referenced source line.
screenReaderAfter 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.
contrastInk on surface 14:1; state dyes only as marks with words.
targetControls are 44 px.

Content

SlotLengthVoice
caption2 sentencesScripted 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

AspectValue
unittests/unit/site-system.test.ts: renders every do and don't example through the registry and checks the classes it owns
visualNot yet: there are no screenshot baselines; the Library page is checked for sideways scroll at 1440 px by tests/site/system.spec.ts
a11ytests/site/system.spec.ts: axe (0 serious or critical) on the element's Library page in light and dark
parityscripts/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.

Open in Storybook

Start with a conversation about your system.

We read your system, show you what we found, and agree with your team what to fix first.