# Artifact requirements

An artifact node stores its artifact kind in `type` and its relative file path in `content`. A text node instead stores inline body text in `content`.

## Storage

- Files use stable paths: `artifacts/<project-id>/<node-id>.<ext>`.
- HTML, Markdown, SVG, and decoded media are real files.
- Remote media is a `.url` reference file.
- The database stores only the artifact `type` and its relative path in `content`; MIME and state are derived.
- Agents may edit artifact files directly. Brancha watches them and refreshes previews.
- Back up the complete Brancha data directory, not the SQLite file alone.

## HTML

- Produce one complete, self-contained HTML document.
- Inline CSS and JavaScript; do not load external resources.
- Use CSS, inline SVG, or emoji when imagery is needed.

## Markdown

- Produce complete, usable Markdown rather than an outline.
- Do not leave placeholders.

## SVG

- Produce one self-contained `<svg>` with a `viewBox` and inline styling.
- Do not include scripts.

## Image, video, and audio

- Generate media through the user's own Agent and provider integration.
- Never send provider API keys to Brancha.
- Attach only an HTTPS URL, a matching `data:image/*`, `data:video/*`, `data:audio/*` URI, or a loopback URL.
- Brancha uses native media controls and never autoplays.
- Remote URLs disclose the user's IP address to the media host when previewed.

Make alternative artifacts materially different in structure, visual language, or tone—not merely different colors.
