# What Artifact Checks Does Archify Perform After Rendering?

> Archify performs five artifact checks after rendering: schema, layout, HTML/SVG, route validation, and label-to-route clearance. Ensure your project's integrity with Archify.

- Repository: [tt-a1i/archify](https://github.com/tt-a1i/archify)
- Tags: internals
- Published: 2026-09-01

---

**Archify performs five deterministic, atomic validation checks after rendering: schema validation, layout validation, HTML/SVG validation, route validation, and label-to-route clearance.**

Archify is an open-source diagramming and visualization tool from `tt-a1i/archify` that generates HTML and SVG artifacts from typed JSON workflow definitions. After each render, the tool enforces strict post-render validation to guarantee that only well-formed, consistent, and safe artifacts replace previously verified outputs. This validation pipeline ensures reproducible, trustworthy diagrams suitable for production showcases.

## The Five Post-Render Artifact Checks

Once Archify completes rendering, it sequentially executes five atomic checks defined in the source code. All checks must pass before an artifact can be **delivered**—that is, atomically promoted to replace the last-known-good version.

### Schema Validation

**Schema validation** confirms that the generated JSON intermediate representation (IR) conforms to Archify's formal schema. The schema definitions reside in [`archify/schemas/README.md`](https://github.com/tt-a1i/archify/blob/main/archify/schemas/README.md) and establish the contract for valid workflow structures, node types, edge properties, and metadata fields. Any deviation triggers a validation failure with a machine-readable diagnostic.

### Layout Validation

**Layout validation** enforces deterministic placement rules on the rendered diagram. This check verifies:

- No overlapping nodes
- Proper grid alignment
- Consistent spacing and positioning
- Adherence to the layout algorithm's guarantees

Failures emit codes like `LAYOUT_OVERLAP` with suggested automatic fixes such as `recomputeLayout`.

### HTML and SVG Validation

**HTML/SVG validation** parses the produced markup to catch structural errors, missing tags, illegal attributes, or malformed SVG paths. This ensures browser-safe output and prevents rendering failures in downstream consumers. The validation runs against both the HTML wrapper and embedded SVG elements.

### Route Validation

**Route validation** verifies that every directed edge in the diagram maps to a valid, reachable route in the underlying workflow model. This prevents disconnected or phantom connections that would misrepresent the actual data or control flow.

### Label-to-Route Clearance

**Label-to-route clearance** checks that node and edge labels correctly correspond to the routes they annotate. This final check ensures no stray labels remain unassociated and that every textual annotation accurately reflects its underlying semantic connection.

## Validation Commands in Practice

### Running Standalone Validation

Validate a workflow JSON file without attempting delivery:

```bash

# Execute all five checks and emit a structured JSON receipt

node archify/bin/archify.mjs validate workflow examples/agent-tool-call.workflow.json \
  --quality showcase --json

```

The `validate` command in `archify/bin/archify.mjs` coordinates with `archify/lib/validate.mjs` (or equivalent) to run the complete check suite.

### Rendering with Automatic Delivery

Render and atomically replace the target file only if all checks succeed:

```bash

# Full pipeline: render → validate → deliver (or abort)

node archify/bin/archify.mjs deliver workflow examples/agent-tool-call.workflow.json \
  /tmp/workflow.html --quality showcase --open --json

```

### Handling Validation Failures

When any post-render artifact check fails, Archify returns a structured receipt instead of delivering the artifact:

```json
{
  "diagnostics": [
    {
      "code": "LAYOUT_OVERLAP",
      "message": "Node positions overlap – adjust layout.",
      "supportedFixes": ["recomputeLayout"]
    }
  ]
}

```

This receipt enables agents or developers to apply automatic fixes without losing the previously verified output.

## Key Source Files

| File | Role |
|------|------|
| `archify/bin/archify.mjs` | CLI entry point orchestrating `validate` and `deliver` commands |
| `archify/lib/validate.mjs` | Implements all five post-render validation checks |
| [`archify/schemas/README.md`](https://github.com/tt-a1i/archify/blob/main/archify/schemas/README.md) | Defines the JSON IR schema for schema validation |
| [`archify/SKILL.md`](https://github.com/tt-a1i/archify/blob/main/archify/SKILL.md) | Formal contract describing validation workflow and artifact guarantees |

According to the Archify README at line 185-186: *"Atomic validation before delivery — schema, layout, HTML/SVG, route, and label-to-route clearance checks must all pass before a showcase artifact replaces the last known good output."*

## Summary

- Archify enforces **five atomic post-render checks** before any artifact can be delivered
- **Schema, layout, HTML/SVG, route, and label-to-route clearance** validation ensures correctness, safety, and consistency
- The `validate` and `deliver` commands in `archify/bin/archify.mjs` expose this pipeline to CLI users
- Failed checks return **machine-readable receipts** with automatic fix suggestions, preserving the previous good state

## Frequently Asked Questions

### What happens if a post-render check fails?

Archify aborts delivery and returns a JSON receipt containing the failing diagnostic code, human-readable message, and supported automatic fixes. The previously verified artifact remains untouched, ensuring no broken output reaches production.

### Can I run validation without rendering?

Yes. Use `node archify/bin/archify.mjs validate` to execute all five checks against an existing workflow JSON file without generating or delivering new artifacts.

### Where are the validation rules defined?

The schema rules reside in [`archify/schemas/README.md`](https://github.com/tt-a1i/archify/blob/main/archify/schemas/README.md). The implementation of layout, HTML/SVG, route, and label checks is located in `archify/lib/validate.mjs` (or equivalent modules), invoked by the CLI entry point at `archify/bin/archify.mjs`.

### Does Archify support automatic fixes for validation failures?

Yes. When validation fails, the returned receipt includes `supportedFixes` array with actionable remedies such as `recomputeLayout` for overlapping nodes. These fixes can be applied programmatically or manually to resolve the issue.