Skip to main content

Squillify development is paused indefinitely. Read why, and discover what this experiment achieved. Read the story

MicroSkills Reference

Snapshot Diff

quality.snapshot_diff

ProductionBounded custom (Class B)Deterministicstrictfastv1.0.0
No network

Overview

You send the snapshot you saved and the one you just produced, as text or as JSON, and we show you the difference the way a code review would: hunks with a few lines of context, each line marked as kept, added, or removed. First we tidy both sides the same way, using only the steps you ask for — drop the fields that change every run, settle on one line ending, trim trailing spaces — and JSON is put in a canonical shape so key order never shows up as a change. You also get a hash of each tidied side. Nothing is saved and no change is ever approved for you.

Snapshot tests fail for two reasons — something really changed, or a timestamp moved — and telling those apart by eye is exactly the work you wanted automated.

Reliability

The same pair and the same steps always give the same hunks and the same hashes, and nothing leaves the platform. A json snapshot is always canonicalised before comparing — keys sorted throughout, indented two spaces, one line ending — so key order and formatting never register as a change, which also means the hash is stable across serialisers. Five failures can stop the call. INVALID_JSON_SNAPSHOT means a side declared json but does not parse: fix the value and send it again. SNAPSHOT_TYPE_MISMATCH means one side is text and the other json, so set both types the same. NORMALIZER_INVALID means a step is configured wrong — json_path_remove without a paths array, a pointer not starting with a slash, json_path_remove on a text snapshot, or a line_endings value that is not lf, crlf, or cr. NORMALIZER_UNSUPPORTED means a step's type is not one of those three. DIFF_COMPLEXITY_LIMIT_EXCEEDED means the two sides multiply out past 25000000 token pairs, which mostly happens at character granularity: move to word or line, or compare smaller pieces. All five need a change from you, so retrying unchanged fails identically. A difference itself is a normal successful answer — read equal and hunks.

Context footprint

The reply carries every token inside each hunk, so it grows with how much changed rather than how big the snapshots are; lower maxDiffHunks or contextLines to keep it tight. A successful call costs 1 execution credit.

When to use it

When two snapshots disagree and you want to see how, minus the noisy fields.

When you want the new snapshot saved, or a judgement on whether it is fine.

Scope

Note
We tidy two snapshots the same way and show you where they differ.

Non-goals

  • Does not write or update a stored snapshot
  • Does not decide that a change is acceptable
  • Does not judge whether two different wordings mean the same thing
  • Does not run pattern replacements you invent — only the three tidying steps named here

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysisvalidation

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call1 credit

File handling

Accepts file_refProduces file_refMax input2 MB

How we handle your data

Sensitive input, safe output
What this means

This skill may receive sensitive content, but it does not target sensitive data and returns only a structured non-sensitive result.

Squillify guarantees
  • Runs inside Squillify
  • This skill runs inside Squillify.
  • Payloads are not sent to an external service by this skill.
  • Squillify does not permanently store submitted payloads.
  • Telemetry records metadata only, not submitted content.
  • Submitted payloads are not used for training.
  • Submitted payloads are not reviewed by humans.
  • This skill does not target sensitive data.
  • The response does not contain submitted content.
Your responsibility

Squillify does not determine whether submitted content is sensitive. Your application is responsible for deciding what data it is allowed to submit. Your application is responsible for securing the response.

Read the Microskill Data Handling Policy

Input schema

FieldTypeRequiredDescription
expectedobjectYesClosed saved snapshot with optional type text or json and a value holding the body.
actualobjectYesClosed produced snapshot shaped like expected; its type must match the other side.
normalizersarrayNoTidying steps applied to both sides in listed order, 0 through 32 closed objects; omit it to compare after JSON canonicalisation only.
optionsobjectNoClosed diff controls for token size, context and hunk cap; omit the object for line granularity, 3 context lines and 200 hunks.

Output schema

FieldTypeRequiredDescription
equalbooleanYesTrue when the tidied sides matched.
hunksarrayYesChanged regions in order, 0 through 200 closed hunks; empty when the sides match.
summaryobjectYesClosed totals with added, removed and changed token counts plus lowercase SHA-256 hashes of each tidied side.
appliedNormalizersarrayYesTidying step types applied, 0 through 32 strings in application order; empty when none were asked.
_metaobjectYesClosed bookkeeping with the token granularity, named diff profile and whether hunks were truncated.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"quality.snapshot_diff","input":{"expected":{"type":"text","value":"a"},"actual":{"type":"text","value":"a"}}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

const sq = new Squillify({ apiKey: process.env.SQUILLIFY_API_KEY });

const { output } = await sq.execute("quality.snapshot_diff", {"actual":{"type":"text","value":"a\nc"},"expected":{"type":"text","value":"a\nb"}});

Errors

CodeHTTPRetryableDescription
VALIDATION_ERROR400NoThe request payload failed schema validation.
UNAUTHORIZED401NoMissing or invalid API key.
SKILL_NOT_ACCESSIBLE403NoThe API key is not granted access to this skill.
SKILL_NOT_AVAILABLE_FOR_PLAN403NoThis skill is not included in your current plan.
PLAN_ELIGIBILITY_UNAVAILABLE503YesPlan eligibility could not be decided. Retry after backoff.
SKILL_NOT_FOUND404NoThe requested skill or version does not exist.
TENANT_RATE_LIMITED429YesRequest rate limit exceeded. Retry after backoff.
QUOTA_EXCEEDED429YesPlan quota exhausted. Retryable once the quota period resets.
EXECUTION_TIMEOUT504YesExecution exceeded the allowed time budget.
INVALID_JSON_SNAPSHOT400NoThe request payload failed this skill's input validation.
SNAPSHOT_TYPE_MISMATCH400NoThe request payload failed this skill's input validation.
NORMALIZER_UNSUPPORTED400NoThe skill does not support the requested variant.
NORMALIZER_INVALID400NoThe request payload failed this skill's input validation.
DIFF_COMPLEXITY_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not write or update a stored snapshot
  • Does not decide that a change is acceptable
  • Does not judge whether two different wordings mean the same thing
  • Does not run pattern replacements you invent — only the three tidying steps named here
  • Saving or approving the new snapshot
  • Comparing prose for meaning rather than characters

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "quality.snapshot_diff",
  "input": {
    "actual": {
      "type": "text",
      "value": "a\nc"
    },
    "expected": {
      "type": "text",
      "value": "a\nb"
    }
  }
}

Examples

A single line replaced, shown with its neighbour

Inputjson
{
  "actual": {
    "type": "text",
    "value": "a\nc"
  },
  "expected": {
    "type": "text",
    "value": "a\nb"
  }
}
Expected outputjson
{
  "equal": false,
  "appliedNormalizers": [],
  "_meta": {
    "granularity": "line",
    "diffProfile": "text-diff-1",
    "truncated": false
  },
  "summary": {
    "expectedHash": "7e18f737311b2dc3b2f269dd78396b0351f14fb66efa879f768cb23181883c78",
    "added": 1,
    "changed": 1,
    "removed": 1,
    "actualHash": "9e58d7137c654f526a7a7c9cbab79c2e859b4dfbb579d1d6dd3aa4113a8a909b"
  },
  "hunks": [
    {
      "newCount": 2,
      "oldCount": 2,
      "lines": [
        {
          "value": "a",
          "op": "context"
        },
        {
          "value": "b",
          "op": "remove"
        },
        {
          "value": "c",
          "op": "add"
        }
      ],
      "newStart": 1,
      "oldStart": 1
    }
  ]
}

Two snapshots that match, with matching hashes

Inputjson
{
  "actual": {
    "type": "text",
    "value": "ok"
  },
  "expected": {
    "type": "text",
    "value": "ok"
  }
}
Expected outputjson
{
  "equal": true,
  "appliedNormalizers": [],
  "_meta": {
    "granularity": "line",
    "diffProfile": "text-diff-1",
    "truncated": false
  },
  "summary": {
    "expectedHash": "2689367b205c16ce32ed4200942b8b8b1e262dfc70d9bc9fbc77c49699a4f1df",
    "added": 0,
    "changed": 0,
    "removed": 0,
    "actualHash": "2689367b205c16ce32ed4200942b8b8b1e262dfc70d9bc9fbc77c49699a4f1df"
  },
  "hunks": []
}
  • Fail a snapshot test and show the reviewer exactly what moved
  • Compare a golden file while ignoring the timestamp inside it
  • Store the hash of a tidied snapshot and notice when output drifts

Avoid for

  • Saving or approving the new snapshot
  • Comparing prose for meaning rather than characters

Composable with

Safety & privacy

  • Runs without calling any external service.
  • Your payloads are never stored permanently.
  • Telemetry captures metadata only — never your payload contents.
  • We never train models on your payloads.
  • No human reviews your payloads.

Tags

qualityjsonvalidation