Skip to main content

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

MicroSkills Reference

Summarize Redline Statistics

legal.redline_statistics

ProductionBounded custom (Class B)Deterministicstrictmoderatev1.0.0
No network

Overview

You send INSERT, DELETE, REPLACE and MOVE changes with their old and new text. We count changes, words and characters by type, section and author, using ICU word boundaries when you ask for UNICODE. Raw text is not returned and materiality is not judged. A successful call costs 2 execution credits.

Redline summaries are counting problems; returning the edited prose or a materiality score would be a different product.

Reliability

REDLINE_LIMIT_EXCEEDED — trigger: more than 100000 changes; retryable: no; next: split the list. REDLINE_TEXT_LIMIT_EXCEEDED — trigger: more than 10 MiB of oldText plus newText; retryable: no; next: trim the text.

Context footprint

Counts only; source phrases stay off the result. A successful call costs 2 execution credits.

When to use it

When the change list is already computed and you need counts by type, section and author.

When you still need a diff engine or a view on whether a change is material.

Powered by ICU4J UAX#29 word boundaries when wordSegmentation is UNICODE, otherwise whitespace splits.

Scope

Note
Aggregates caller-supplied redline changes into counts and a length-weighted ratio.

Non-goals

  • Does not generate a diff
  • Does not judge materiality
  • Does not parse track-changes markup

Properties

IdempotentRetry safeStreaming supportedFile input supportedRequires external service

Capabilities

analysis

Cost & billing

Flat rate per invocation

MetercallsBillable onsuccessCost per call2 credits

File handling

Accepts file_refProduces file_refMax input12 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
changesarrayNoAlready computed redline changes, 0 through 100001 entries; runtime accepts at most 100000. Omit it for none.
wordSegmentationstringNoUNICODE or WHITESPACE; omit it for UNICODE.

Output schema

FieldTypeRequiredDescription
changeCountintegerYesNumber of change objects counted.
byTypeobjectYesClosed per-type totals keyed by INSERT, DELETE, REPLACE and MOVE, each with changes, words, oldWords and newWords.
bySectionobjectYesPer-section INSERT, DELETE, REPLACE and MOVE counts keyed by the supplied section label or (none).
byAuthorobjectYesPer-author INSERT, DELETE, REPLACE and MOVE counts keyed by the supplied author label or (none).
insertedCharactersintegerYesInserted character total.
deletedCharactersintegerYesDeleted character total.
changeRationumberNoLength-weighted change ratio; omit it when the oldText denominator is zero.
changeRatioUndefinedReasonstringNoZERO_DENOMINATOR when changeRatio is omitted.
wordSegmentationstringYesUNICODE or WHITESPACE that was applied.
assumptionsarrayYesCaller-visible mechanical assumptions for this answer, such as default weekend days or a grammar version, never a legal conclusion.
limitationsstringYesFixed notice that only supplied parameters are applied and that validity, compliance and enforceability are not determined.

API contract

POST /v1/execute
curl
curl -sS -X POST "$BASE/v1/execute" -H "Authorization: Bearer $KEY" -H 'Content-Type: application/json' -d '{"skillKey":"legal.redline_statistics","input":{"changes":[{"type":"INSERT","newText":"payment term"}]}}'
Integrations
TypeScript SDK
import { Squillify } from "@squillify/sdk";

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

const { output } = await sq.execute("legal.redline_statistics", {"changes":[{"newText":"payment term","section":"5","type":"INSERT","author":"alex"},{"author":"alex","oldText":"ten days","type":"REPLACE","newText":"thirty days","section":"5"}]});

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.
REDLINE_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.
REDLINE_TEXT_LIMIT_EXCEEDED429NoA size, quota, rate, or time limit was exceeded.

Other limits

LimitValue
Recommended inline bytes32 KiB

Limitations

  • Does not generate a diff
  • Does not judge materiality
  • Does not parse track-changes markup
  • Creating the redline
  • Scoring negotiating intent

How to call

POST /v1/execute (requires authentication)

Request bodyjson
{
  "skillKey": "legal.redline_statistics",
  "input": {
    "changes": [
      {
        "newText": "payment term",
        "section": "5",
        "type": "INSERT",
        "author": "alex"
      },
      {
        "author": "alex",
        "oldText": "ten days",
        "type": "REPLACE",
        "newText": "thirty days",
        "section": "5"
      }
    ]
  }
}

Examples

One insert and one replace in section 5

Inputjson
{
  "changes": [
    {
      "newText": "payment term",
      "section": "5",
      "type": "INSERT",
      "author": "alex"
    },
    {
      "author": "alex",
      "oldText": "ten days",
      "type": "REPLACE",
      "newText": "thirty days",
      "section": "5"
    }
  ]
}
Expected outputjson
{
  "bySection": {
    "5": {
      "INSERT": 1,
      "DELETE": 0,
      "REPLACE": 1,
      "MOVE": 0
    }
  },
  "deletedCharacters": 8,
  "byAuthor": {
    "alex": {
      "INSERT": 1,
      "DELETE": 0,
      "REPLACE": 1,
      "MOVE": 0
    }
  },
  "byType": {
    "INSERT": {
      "changes": 1,
      "words": 2,
      "oldWords": 0,
      "newWords": 2
    },
    "DELETE": {
      "changes": 0,
      "words": 0,
      "oldWords": 0,
      "newWords": 0
    },
    "REPLACE": {
      "changes": 1,
      "words": 4,
      "oldWords": 2,
      "newWords": 2
    },
    "MOVE": {
      "changes": 0,
      "words": 0,
      "oldWords": 0,
      "newWords": 0
    }
  },
  "changeCount": 2,
  "changeRatio": 3.875,
  "limitations": "Calculations use only the parameters supplied in this call. No implicit legal rule is applied, and the answer does not determine validity, compliance or enforceability.",
  "insertedCharacters": 23,
  "wordSegmentation": "UNICODE",
  "assumptions": [
    "Word counts use ICU UAX#29 boundaries when wordSegmentation is UNICODE, otherwise whitespace splits.",
    "REPLACE contributes oldWords and newWords separately; MOVE is counted as a relocation, not as insert plus delete words."
  ]
}
Tip
REPLACE reports oldWords and newWords separately; raw phrases are not returned.

No changes leaves the ratio undefined

Inputjson
{
  "changes": []
}
Expected outputjson
{
  "bySection": {},
  "deletedCharacters": 0,
  "changeRatioUndefinedReason": "ZERO_DENOMINATOR",
  "byAuthor": {},
  "byType": {
    "INSERT": {
      "changes": 0,
      "words": 0,
      "oldWords": 0,
      "newWords": 0
    },
    "DELETE": {
      "changes": 0,
      "words": 0,
      "oldWords": 0,
      "newWords": 0
    },
    "REPLACE": {
      "changes": 0,
      "words": 0,
      "oldWords": 0,
      "newWords": 0
    },
    "MOVE": {
      "changes": 0,
      "words": 0,
      "oldWords": 0,
      "newWords": 0
    }
  },
  "changeCount": 0,
  "limitations": "Calculations use only the parameters supplied in this call. No implicit legal rule is applied, and the answer does not determine validity, compliance or enforceability.",
  "insertedCharacters": 0,
  "wordSegmentation": "UNICODE",
  "assumptions": [
    "Word counts use ICU UAX#29 boundaries when wordSegmentation is UNICODE, otherwise whitespace splits.",
    "REPLACE contributes oldWords and newWords separately; MOVE is counted as a relocation, not as insert plus delete words."
  ]
}
Tip
With no oldText characters, changeRatio is omitted and ZERO_DENOMINATOR is reported.
  • Summarize an already extracted redline list
  • Split REPLACE word counts into old and new

Avoid for

  • Creating the redline
  • Scoring negotiating intent

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

textvalidationlegal