# Dedupe last check

`dedupe-last-check` · version 1.0.0 · Numbers & math · free, no key needed

Check an exact last-wins SameValueZero deduplication claim and report its first discrepancy.

**Use when you need to: check last deduplication claim · validate last duplicate removal · audit last unique result.**

## Decide before calling

Read the [versioned contract](/v1/tools/dedupe-last-check/versions/1.0.0) and the supported scope below. Reuse `dedupe-last-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 `dedupe-last-check@1.0.0` for check last deduplication 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 last deduplication claim
- validate last duplicate removal
- audit last unique result
- find first last dedupe error
- verify ordered last deduplication
- compare claimed last unique list

## Not supported

- compute and return a replacement claim
- deduplicate objects or arrays as scalar values
- apply Unicode or numeric coercion

## Behavior

- It verifies retained last occurrences in their original source-index order.
- Values are JSON scalars: null, booleans, strings, and safe integers except negative zero; types remain distinct.
- A false claim is never repaired; the lowest claim index that differs is returned.
- Empty arrays are allowed. Strings are compared exactly without normalization.

## Input

- `source` (array of null or boolean or integer or string, required): max items 10000
- `claim` (array of null or boolean or integer or string, required): max items 10000

## Output

- `valid` (boolean, required)
- `reason` (one of "value_mismatch", "length_mismatch", optional)
- `discrepancy` (object, optional)
- `reference_version` (constant "ECMA-262-2026-SameValueZero-Map", required)

## Limits

- max items: 10000
- max string bytes: 4096
- max input bytes: 1000000

## Example

Request input:

```json
{
  "source": [
    "a",
    "b",
    "a"
  ],
  "claim": [
    "b",
    "a"
  ]
}
```

Response:

```json
{
  "result": {
    "valid": true,
    "reference_version": "ECMA-262-2026-SameValueZero-Map"
  }
}
```

## How to call it

### MCP

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

```json
{
  "id": "dedupe-last-check",
  "version": "1.0.0",
  "input": {
    "source": [
      "a",
      "b",
      "a"
    ],
    "claim": [
      "b",
      "a"
    ]
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/dedupe-last-check/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"source":["a","b","a"],"claim":["b","a"]}'
```

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

### CLI

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

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

## Related tools

- [Dedupe first check](/tools/dedupe-first-check): Check an exact first-wins SameValueZero deduplication claim and report its first discrepancy.
- [Dedupe keyed check](/tools/dedupe-keyed-check): Check an exact keyed Map deduplication claim and report its first discrepancy.
- [Join inner result check](/tools/join-inner-result-check): Check a claimed ordered inner join index result and report its first discrepancy.
- [Join left result check](/tools/join-left-result-check): Check a claimed ordered left join index result and report its first discrepancy.
- [Join semi result check](/tools/join-semi-result-check): Check a claimed ordered semi-join index result and report its first discrepancy.
- [Unique key claim check](/tools/unique-key-claim-check): Check an exact uniqueness claim and first-duplicate certificate under an explicit SQL null policy.
