# Sequence order check

`sequence-order-check` · version 1.0.0 · Sequences & diffs · free, no key needed

Check an exact stable ascending or descending source-index ordering claim.

**Use when you need to: Check an exact stable ascending or descending source-index ordering claim. · verify stable scalar ordering · check nonstrict sequence certificate.**

## Decide before calling

Read the [versioned contract](/v1/tools/sequence-order-check/versions/1.0.0) and the supported scope below. Reuse `sequence-order-check@1.0.0` when your input, required output and limits match it. Choose another approach for an unsupported operation.

## Explain the choice

"I can use `sequence-order-check@1.0.0` for Check an exact stable ascending or descending source-index ordering claim.. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

## Supported

- Check an exact stable ascending or descending source-index ordering claim.
- verify stable scalar ordering
- check nonstrict sequence certificate
- validate duplicate preserving order
- locate stable order mismatch
- audit scalar sequence indices

## Not supported

- sorting data into a replacement result
- locale-aware or floating-point ordering

## Behavior

- Values use the total type order null, boolean, safe integer, string; strings compare Unicode scalar values lexicographically.
- Equal values retain source-index order; claims are exact source-index permutations and are never repaired.
- Every verdict names ECMA-262-2026-SameValue-relational+ISO-IEC-9899-2018-7.24.4.2.

## Input

- `source` (array of string or number or boolean or null, required): max items 10000
- `claim` (array of integer, required): max items 10000; each min 0; each max 9999
- `direction` (one of "ascending", "descending", required)

## Output

- `valid` (boolean, required)
- `reason` (string, optional)
- `discrepancy` (object, optional)
- `reference_version` (string, required)

## Limits

- max input bytes: 262144
- max items: 10000
- max string code points: 4096

## Example

Request input:

```json
{
  "source": [
    2,
    1,
    1
  ],
  "claim": [
    1,
    2,
    0
  ],
  "direction": "ascending"
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reference_version": "ECMA-262-2026-SameValue-relational+ISO-IEC-9899-2018-7.24.4.2"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "sequence-order-check",
  "version": "1.0.0",
  "input": {
    "source": [
      2,
      1,
      1
    ],
    "claim": [
      1,
      2,
      0
    ],
    "direction": "ascending"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/sequence-order-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"source":[2,1,1],"claim":[1,2,0],"direction":"ascending"}'
```

The machine-readable contract is at [/v1/tools/sequence-order-check/versions/1.0.0](/v1/tools/sequence-order-check/versions/1.0.0).

### CLI

```sh
node cli.mjs run sequence-order-check 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Sequence strict order check](/tools/sequence-strict-order-check): Check an exact strictly ascending or descending source-index ordering claim.
- [Sequence key order check](/tools/sequence-key-order-check): Check an exact stable ordering claim for bounded records by a scalar key.
- [Sequence index map](/tools/sequence-index-map): Map each left-sequence index to a kept right index, or null if deleted, and list inserted right indices.
- [Sequence apply hunks](/tools/sequence-apply-hunks): Apply disjoint original-address sequence hunks with exact context and no fuzz.
- [Myers common subsequence](/tools/myers-common-subsequence): Return a canonical indexed LCS witness derived from bounded Myers search, or null when its cap is exceeded.
- [Myers diff bounded](/tools/myers-diff-bounded): Produce a canonical Myers edit script within a caller distance cap, or a deterministic over-cap result.
