# Regular Trace Edit Distance Verifier

> Regular Trace Edit Distance Verifier is a paid API for AI agents from detect.halowerk.com, paid per call via x402, $0.002/call, status unknown (last checked 2026-11-04).

Verifies the minimum edit distance (insertions, deletions, substitutions) between a finite event trace and a regular language defined by a finite automaton

## Facts

- Endpoint: POST https://detect.halowerk.com/v1/workflow/workflow-regular-trace-edit-distance?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-11-04
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/regular-trace-edit-distance-verifier-fb0b5a30
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_EKffHenoeqU3ZdgYz_kPc

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 regular-trace-edit-distance-verifier-fb0b5a30 -d '<json body>'
```

Example prompt: Check if the claimed minimum edit cost of 3 is correct for repairing the trace [0, 1, 2, 1] against this 4-state automaton with alphabet size 3, initial state 0, accepting states [3], and transitions [{from:0,to:1,symbol:0},{from:1,to:2,symbol:1},{from:2,to:3,symbol:2}].

## When to prefer this

Use this endpoint when you need to formally verify the minimum edit distance between a finite event trace and a regular language (DFA/NFA), especially when an agent or automated system has produced a claimed repair cost that must be independently audited. Preferred over general string-distance tools when the target language is defined by a finite automaton rather than a fixed reference string, and when correctness of the cost claim is critical for compliance or trust.

## Known failure modes

- Claimed cost of -1 may indicate an unknown/uncomputed cost — endpoint treats it as a probe
- Trace length exceeding 128 items rejected
- Alphabet size or state count out of range causes validation error
- Transition references to non-existent states or symbols rejected
- Automaton with no accepting states results in infinite distance

## How this service works

An agent that repairs a finite event trace against a regular contract needs its claimed minimum insertion deletion and substitution cost checked over every accepted trace.

## Output

Returns whether the claimed minimum edit distance (insertions, deletions, substitutions) between the supplied trace and the nearest accepted string in the regular language is correct, along with the true minimum cost computed over all accepted traces of the automaton.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "artifact": {
   "type": "object",
   "required": [
    "states",
    "alphabet",
    "initial",
    "finals",
    "transitions",
    "trace",
    "claimed_cost"
   ],
   "properties": {
    "trace": {
     "type": "array",
     "items": {
      "type": "integer",
      "maximum": 7,
      "minimum": 0
     },
     "maxItems": 128,
     "minItems": 0
    },
    "finals": {
     "type": "array",
     "items": {
      "type": "integer",
      "maximum": 31,
      "minimum": 0
     },
     "maxItems": 32,
     "minItems": 0
    },
    "states": {
     "type": "integer",
     "maximum": 32,
     "minimum": 1
    },
    "initial": {
     "type": "integer",
     "maximum": 31,
     "minimum": 0
    },
    "alphabet": {
     "type": "integer",
     "maximum": 8,
     "minimum": 1
    },
    "transitions": {
     "type": "array",
     "items": {
      "type": "object",
      "required": [
       "from",
       "to",
       "symbol"
      ],
      "properties": {
       "to": {
        "type": "integer",
        "maximum": 31,
        "minimum": 0
       },
       "from": {
        "type": "integer",
        "maximum": 31,
        "minimum": 0
       },
       "symbol": {
        "type": "integer",
        "maximum": 7,
        "minimum": 0
       }
      },
      "additionalProperties": false
     },
     "maxItems": 256,
     "minItems": 0
    },
    "claimed_cost": {
     "type": "integer",
     "maximum": 160,
     "minimum": -1
    }
   },
   "additionalProperties": false
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/regular-trace-edit-distance-verifier-fb0b5a30/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from detect.halowerk.com](https://www.zero.xyz/host/detect.halowerk.com/llms.txt)
