# WritersLogic Migration Reversibility Classifier

> WritersLogic Migration Reversibility Classifier is a paid API for AI agents from agents.writerslogic.com, paid per call via x402, $0.005/call, status unknown (last checked 2026-11-19).

Classifies each SQL migration statement as reversible, needs-backup, needs-original-definition, or irreversible, and provides a mechanical inverse statement where possible

## Facts

- Endpoint: POST https://agents.writerslogic.com/api/v1/migration-reversibility?utm_source=zero.xyz
- Price: $0.005/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-19
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/writerslogic-migration-reversibility-classifier-dc35ef47
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_IlL7YiIqSy3znSZh-q5v6

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability writerslogic-migration-reversibility-classifier-dc35ef47 -d '<json body>'
```

Example prompt: Can you check this PostgreSQL migration for reversibility? I have a script that drops a column and alters a type — I want to know which statements are irreversible, which need a backup first, and get rollback SQL for anything that can be undone.

## When to prefer this

Use this endpoint when an AI agent needs to review or write database schema migrations and must assess rollback safety, data loss risk, or generate inverse statements without executing any SQL. Ideal for CI/CD pipelines, code review agents, or migration planning tools that need a fast, deterministic, tokenizer-level analysis of Postgres, MySQL, or SQLite migrations without database connectivity.

## Known failure modes

- Unsupported statement forms return 'unsupported' classification rather than an error
- Input exceeding 20000 characters is rejected
- Unknown dialect values cause validation error
- Complex or vendor-specific syntax may fall back to 'unsupported'
- No row-count or runtime data is available, so constraint-failure risk is static only

## How this service works

Pay-per-call agents settled in USDC on Base via x402. Every response carries a signed provenance envelope.

## Output

A per-statement breakdown classifying each SQL statement as reversible, needs-backup, needs-original-definition, or irreversible. For reversible statements, a mechanical inverse SQL statement is included. Statements the classifier does not support are marked as 'unsupported'. Hazard flags are raised for DROP TABLE/COLUMN, TRUNCATE, unbounded DELETE/UPDATE, lossy type changes, NOT NULL/constraint violations, table-rewrite and lock hazards, and MySQL non-transactional DDL.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "sql": {
   "type": "string",
   "maxLength": 20000,
   "description": "The migration's statements."
  },
  "dialect": {
   "enum": [
    "postgres",
    "mysql",
    "sqlite"
   ],
   "type": "string"
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json"
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/writerslogic-migration-reversibility-classifier-dc35ef47/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from agents.writerslogic.com](https://www.zero.xyz/host/agents.writerslogic.com/llms.txt)
