Sustema

ENTITY developer reference

Downloads and offline examples

Candidate documentation for reading and synthetic examples. Account creation, live API access, SDKs, collections and MCP are not available here. A released service profile and matching integration instructions are required before use.

Choose materials by their stated scope. The source examples below can be inspected and saved. They do not supply a released contract, authenticated starter, SDK or service connection.

Release materials

Current availability and the evidence needed before use
MaterialAvailabilityBefore use
Public release bundleUnavailableAccepted release with matching OpenAPI, dictionary, errors, binding and original canonical bytes. Read binding guidance.
Executable API collectionUnavailableQualified importer, release binding and authenticated behaviour. Read collection guidance.
Authenticated code startersUnavailableRelease-matched setup, credentials, result and recovery cases for TypeScript, Python and Elixir.
MCP connectionUnavailableQualified endpoint, OAuth flow, client compatibility and accounting behaviour. Read MCP guidance.

The candidate API reference remains available for reading. Making a file downloadable would not establish release acceptance or service access.

Offline bundle-verifier source

Candidate examples · checks and independent review pending. These are the existing three-language local integrity examples. Importing them performs no file or network access. They accept supplied bytes and a decoded binding; they do not fetch a bundle, authenticate a capability profile or make a business request.

The retained fixtures are inactive, and the generic fixture has no profile. The examples always return new_work_allowed: false and revision_independently_verified: false. They preserve a supplied revision without independently verifying it. No release artifact or capability snapshot is supplied by these downloads.

  • Download TypeScript verifier source
    Filename
    verify-bundle.ts
    Exact UTF-8 file size
    5534 bytes
    File SHA-256
    052adfdafac2db01a0fc0c68ec9ada9bf0531b5995109149ae330c2993a36d86
  • Download Python verifier source
    Filename
    verify_bundle.py
    Exact UTF-8 file size
    5360 bytes
    File SHA-256
    9897548ed34ce0cd38e619c9be7d2c1b1917538f392abcd2e92826776e6c55dd
  • Download Elixir verifier source
    Filename
    verify_bundle.exs
    Exact UTF-8 file size
    5179 bytes
    File SHA-256
    2002ecc8bd5b45bb5535e187583342f720da77a8dc888cb1a3d9b06b6f34f34e

These hashes describe the source files offered here. They are not canonical contract hashes, an independently trusted release manifest or proof of compatibility. Hosted download readback has not been performed.

Inspect the complete verifier source

Switching language or copying code does not execute the verifier. Each tab contains the unchanged source offered by its download.

TypeScript

/** Local bytes only; importing this module performs no I/O and cannot authorize work. */
import { createHash } from 'node:crypto';

type Flat = Record<string, string | boolean | null>;
type Bytes = Record<string, Uint8Array>;
const PUBLIC = ['generation', 'binding_sha256', 'public_api_sha256', 'public_dictionary_sha256', 'public_errors_sha256'];
const COMMON = [...new Set(['profile', 'active', 'generation', 'api_sha256', 'mcp_sha256', 'dictionary_sha256', 'errors_sha256', ...PUBLIC])];
const GENERIC = [...COMMON, 'status'];
const COMPILED = [...COMMON, 'limits_sha256', 'full_profile_source_sha256', 'adapters_sha256'];
const ARTIFACTS: Record<string, string> = {'openapi.json': 'public_api_sha256', 'dictionary.json': 'public_dictionary_sha256', 'errors.json': 'public_errors_sha256'};
const fail = (reason: string): never => { throw new Error(reason); };
const object = (x: unknown): x is Record<string, unknown> => x !== null && typeof x === 'object' && !Array.isArray(x) && Object.getPrototypeOf(x) === Object.prototype;
const sameKeys = (x: Record<string, unknown>, keys: string[]) => Object.keys(x).length === keys.length && keys.every(k => Object.hasOwn(x, k));
const scalar = (x: unknown): x is string => typeof x === 'string' && !/[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?<![\uD800-\uDBFF])[\uDC00-\uDFFF]/u.test(x);
const hex = (x: unknown): x is string => typeof x === 'string' && /^[a-f0-9]{64}$/.test(x) && x.length === 64;
const utf8 = (x: string) => new TextEncoder().encode(x);
const equal = (a: Uint8Array, b: Uint8Array) => a.length === b.length && a.every((x, i) => x === b[i]);
const digest = (x: unknown): string => x instanceof Uint8Array ? createHash('sha256').update(x).digest('hex') : fail('artifact_must_be_bytes');

export function canonicalBinding(value: unknown): Uint8Array {
  if (!object(value) || Object.entries(value).some(([k, v]) => !scalar(k) || !(v === null || typeof v === 'boolean' || scalar(v)))) fail('unsupported_binding_shape');
  // Python sorts Unicode code points. Do not use JavaScript's UTF-16 default sort.
  const compare = (a: string, b: string) => {
    const aa = Array.from(a, x => x.codePointAt(0)!), bb = Array.from(b, x => x.codePointAt(0)!);
    for (let i = 0; i < Math.min(aa.length, bb.length); i++) if (aa[i] !== bb[i]) return aa[i] - bb[i];
    return aa.length - bb.length;
  };
  const v = value as Flat;
  // JSON.stringify is used ONLY for one scalar, never as an object canonicalizer.
  return utf8('{' + Object.keys(v).sort(compare).map(k => JSON.stringify(k) + ':' + JSON.stringify(v[k])).join(',') + '}');
}

export function verifyBundle(binding: unknown, canonical: Bytes, snapshot: unknown,
                             readable?: Bytes, readableHashes?: Record<string, string>) {
  const encoded = canonicalBinding(binding);
  const b = binding as Flat;
  const generic = sameKeys(b, GENERIC);
  if (!generic && !sameKeys(b, COMPILED)) fail('unsupported_binding_fields');
  if (typeof b.active !== 'boolean' || b.generation !== 'ARCH-COMPLETE-01') fail('unknown_generation_or_invalid_active');
  if (generic ? b.profile !== null || b.status !== 'generic_template_not_released' || b.active : !scalar(b.profile) || !b.profile) fail(generic ? 'invalid_generic_binding' : 'invalid_profile');
  if (Object.entries(b).some(([k, v]) => k.endsWith('_sha256') && !hex(v))) fail('invalid_digest');
  const names = [...Object.keys(ARTIFACTS), 'binding.json'];
  if (!object(canonical) || !sameKeys(canonical, names.map(n => n + '.bytes'))) fail('missing_or_unknown_canonical_artifact');
  if (!(canonical['binding.json.bytes'] instanceof Uint8Array) || !equal(canonical['binding.json.bytes'], encoded)) fail('binding_canonical_bytes_mismatch');
  const withoutSelf = Object.fromEntries(Object.entries(b).filter(([k]) => k !== 'binding_sha256'));
  if (digest(canonicalBinding(withoutSelf)) !== b.binding_sha256) fail('binding_digest_mismatch');
  for (const [name, field] of Object.entries(ARTIFACTS)) if (digest(canonical[name + '.bytes']) !== b[field]) fail('public_artifact_digest_mismatch');
  if (!object(snapshot) || !sameKeys(snapshot, ['profile_id', 'revision', 'contract_binding'])) fail('invalid_snapshot_fields');
  const s = snapshot as Record<string, unknown>;
  if (!scalar(s.profile_id) || !s.profile_id || !scalar(s.revision) || !s.revision) fail('invalid_snapshot_identity');
  const cb = s.contract_binding;
  if (!object(cb) || !sameKeys(cb, PUBLIC) || PUBLIC.some(k => cb[k] !== b[k])) fail('capability_binding_mismatch');
  if (b.profile !== null && s.profile_id !== b.profile) fail('capability_profile_mismatch');
  let readableIntegrity = 'not_verified';
  if (readableHashes !== undefined) {
    if (!object(readableHashes) || !sameKeys(readableHashes, names) || !object(readable) || !sameKeys(readable, names)) fail('incomplete_readable_file_records');
    for (const name of names) if (!hex(readableHashes[name]) || digest(readable![name]) !== readableHashes[name]) fail('readable_file_digest_mismatch');
    readableIntegrity = 'exact_file_hashes_verified';
  }
  const reasons = ['offline_integrity_is_not_release_or_entitlement', 'profile_revision_not_in_bundle'];
  if (!b.active) reasons.push('inactive_binding');
  if (b.profile === null) reasons.push('generic_template_not_profile');
  return {canonical_integrity: 'verified', readable_integrity: readableIntegrity,
    generation: b.generation, profile_id: s.profile_id, supplied_revision: s.revision,
    revision_independently_verified: false, new_work_allowed: false, reasons};
}

Python

"""Offline integrity example. Never authorizes work; no network or file I/O on import."""
import hashlib
import json
import re

GENERATION = "ARCH-COMPLETE-01"
PUBLIC = ("generation", "binding_sha256", "public_api_sha256",
          "public_dictionary_sha256", "public_errors_sha256")
COMMON = {"profile", "active", "generation", "api_sha256", "mcp_sha256",
          "dictionary_sha256", "errors_sha256", *PUBLIC}
GENERIC = COMMON | {"status"}
COMPILED = COMMON | {"limits_sha256", "full_profile_source_sha256", "adapters_sha256"}
ARTIFACTS = {"openapi.json": "public_api_sha256", "dictionary.json": "public_dictionary_sha256",
             "errors.json": "public_errors_sha256"}
HEX = re.compile(r"[a-f0-9]{64}\Z")


def scalar_string(value):
    return isinstance(value, str) and all(not 0xD800 <= ord(c) <= 0xDFFF for c in value)


def canonical_binding(value):
    """Only flat string/bool/null objects; no general JSON canonicalizer claim."""
    if type(value) is not dict or any(not scalar_string(k) or
            not (v is None or type(v) is bool or scalar_string(v)) for k, v in value.items()):
        raise ValueError("unsupported_binding_shape")
    return json.dumps(value, sort_keys=True, separators=(",", ":"),
                      ensure_ascii=False, allow_nan=False).encode("utf-8")


def digest(value):
    if type(value) is not bytes:
        raise ValueError("artifact_must_be_bytes")
    return hashlib.sha256(value).hexdigest()


def verify_bundle(binding, canonical, snapshot, readable=None, readable_hashes=None):
    """snapshot is a selected local binding/profile snapshot, not a validated live response.

    canonical maps four names ending .json.bytes to original bytes. readable_hashes
    is an optional trusted, public-only filename -> exact file SHA256 projection.
    Inputs and any caller-held operation identity are never modified.
    """
    encoded = canonical_binding(binding)
    keys = set(binding)
    if keys not in (GENERIC, COMPILED):
        raise ValueError("unsupported_binding_fields")
    if type(binding["active"]) is not bool or binding["generation"] != GENERATION:
        raise ValueError("unknown_generation_or_invalid_active")
    if keys == GENERIC:
        if binding["profile"] is not None or binding["status"] != "generic_template_not_released" or binding["active"]:
            raise ValueError("invalid_generic_binding")
    elif not scalar_string(binding["profile"]) or not binding["profile"]:
        raise ValueError("invalid_profile")
    if any(not isinstance(v, str) or HEX.fullmatch(v) is None for k, v in binding.items() if k.endswith("_sha256")):
        raise ValueError("invalid_digest")
    if type(canonical) is not dict or set(canonical) != {n + ".bytes" for n in (*ARTIFACTS, "binding.json")}:
        raise ValueError("missing_or_unknown_canonical_artifact")
    if type(canonical["binding.json.bytes"]) is not bytes:
        raise ValueError("artifact_must_be_bytes")
    if canonical["binding.json.bytes"] != encoded:
        raise ValueError("binding_canonical_bytes_mismatch")
    without_self = {k: v for k, v in binding.items() if k != "binding_sha256"}
    if digest(canonical_binding(without_self)) != binding["binding_sha256"]:
        raise ValueError("binding_digest_mismatch")
    for name, field in ARTIFACTS.items():
        if digest(canonical[name + ".bytes"]) != binding[field]:
            raise ValueError("public_artifact_digest_mismatch")
    if type(snapshot) is not dict or set(snapshot) != {"profile_id", "revision", "contract_binding"}:
        raise ValueError("invalid_snapshot_fields")
    if not scalar_string(snapshot["profile_id"]) or not snapshot["profile_id"] or not scalar_string(snapshot["revision"]) or not snapshot["revision"]:
        raise ValueError("invalid_snapshot_identity")
    cb = snapshot["contract_binding"]
    if type(cb) is not dict or set(cb) != set(PUBLIC) or any(cb[k] != binding[k] for k in PUBLIC):
        raise ValueError("capability_binding_mismatch")
    if binding["profile"] is not None and snapshot["profile_id"] != binding["profile"]:
        raise ValueError("capability_profile_mismatch")
    readable_status = "not_verified"
    if readable_hashes is not None:
        names = {*ARTIFACTS, "binding.json"}
        if type(readable_hashes) is not dict or set(readable_hashes) != names or type(readable) is not dict or set(readable) != names:
            raise ValueError("incomplete_readable_file_records")
        for name in names:
            expected = readable_hashes[name]
            if not isinstance(expected, str) or HEX.fullmatch(expected) is None or digest(readable[name]) != expected:
                raise ValueError("readable_file_digest_mismatch")
        readable_status = "exact_file_hashes_verified"
    reasons = ["offline_integrity_is_not_release_or_entitlement", "profile_revision_not_in_bundle"]
    if not binding["active"]:
        reasons.append("inactive_binding")
    if binding["profile"] is None:
        reasons.append("generic_template_not_profile")
    return {"canonical_integrity": "verified", "readable_integrity": readable_status,
            "generation": binding["generation"], "profile_id": snapshot["profile_id"],
            "supplied_revision": snapshot["revision"], "revision_independently_verified": False,
            "new_work_allowed": False, "reasons": reasons}

Elixir

# Pure offline example. Decoded maps use string keys and nil for JSON null.
# No file/network access at module load; no dependency installation or work grant.
defmodule EntityReleaseBundle do
  @public ~w(generation binding_sha256 public_api_sha256 public_dictionary_sha256 public_errors_sha256)
  @common Enum.uniq(~w(profile active generation api_sha256 mcp_sha256 dictionary_sha256 errors_sha256) ++ @public)
  @generic @common ++ ["status"]
  @compiled @common ++ ~w(limits_sha256 full_profile_source_sha256 adapters_sha256)
  @artifacts %{"openapi.json" => "public_api_sha256", "dictionary.json" => "public_dictionary_sha256", "errors.json" => "public_errors_sha256"}
  defp refuse(reason), do: raise(ArgumentError, reason)
  defp plain_map?(v), do: is_map(v) and not is_struct(v)
  defp scalar?(v), do: is_binary(v) and String.valid?(v)
  defp keys?(v, names), do: plain_map?(v) and Enum.sort(Map.keys(v)) == Enum.sort(names)
  defp hex?(v), do: is_binary(v) and Regex.match?(~r/\A[a-f0-9]{64}\z/, v)
  def digest(v) when is_binary(v), do: :crypto.hash(:sha256, v) |> Base.encode16(case: :lower)
  def digest(_), do: refuse("artifact_must_be_bytes")

  defp quote_string(s) do
    body = for c <- String.to_charlist(s), into: "" do
      case c do
        34 -> "\\\""
        92 -> "\\\\"
        8 -> "\\b"
        12 -> "\\f"
        10 -> "\\n"
        13 -> "\\r"
        9 -> "\\t"
        n when n < 32 -> "\\u" <> String.pad_leading(Integer.to_string(n, 16) |> String.downcase(), 4, "0")
        n -> <<n::utf8>>
      end
    end
    "\"" <> body <> "\""
  end
  defp scalar_json(nil), do: "null"
  defp scalar_json(true), do: "true"
  defp scalar_json(false), do: "false"
  defp scalar_json(s), do: quote_string(s)

  def canonical_binding(value) do
    unless plain_map?(value) and Enum.all?(value, fn {k, v} -> scalar?(k) and (is_nil(v) or is_boolean(v) or scalar?(v)) end),
      do: refuse("unsupported_binding_shape")
    # UTF-8 binary lexical order equals code-point order for valid Unicode strings.
    "{" <> (value |> Map.keys() |> Enum.sort() |> Enum.map_join(",", fn k -> quote_string(k) <> ":" <> scalar_json(value[k]) end)) <> "}"
  end

  def verify_bundle(binding, canonical, snapshot, readable \\ nil, readable_hashes \\ nil) do
    encoded = canonical_binding(binding)
    generic = keys?(binding, @generic)
    unless generic or keys?(binding, @compiled), do: refuse("unsupported_binding_fields")
    unless is_boolean(binding["active"]) and binding["generation"] == "ARCH-COMPLETE-01", do: refuse("unknown_generation_or_invalid_active")
    if generic do
      unless is_nil(binding["profile"]) and binding["status"] == "generic_template_not_released" and not binding["active"], do: refuse("invalid_generic_binding")
    else
      unless scalar?(binding["profile"]) and binding["profile"] != "", do: refuse("invalid_profile")
    end
    unless Enum.all?(binding, fn {k, v} -> not String.ends_with?(k, "_sha256") or hex?(v) end), do: refuse("invalid_digest")
    names = Map.keys(@artifacts) ++ ["binding.json"]
    unless keys?(canonical, Enum.map(names, &(&1 <> ".bytes"))), do: refuse("missing_or_unknown_canonical_artifact")
    unless canonical["binding.json.bytes"] === encoded, do: refuse("binding_canonical_bytes_mismatch")
    unless digest(canonical_binding(Map.delete(binding, "binding_sha256"))) == binding["binding_sha256"], do: refuse("binding_digest_mismatch")
    Enum.each(@artifacts, fn {name, field} ->
      unless digest(canonical[name <> ".bytes"]) == binding[field], do: refuse("public_artifact_digest_mismatch")
    end)
    unless keys?(snapshot, ~w(profile_id revision contract_binding)), do: refuse("invalid_snapshot_fields")
    unless scalar?(snapshot["profile_id"]) and snapshot["profile_id"] != "" and scalar?(snapshot["revision"]) and snapshot["revision"] != "", do: refuse("invalid_snapshot_identity")
    cb = snapshot["contract_binding"]
    unless keys?(cb, @public) and Enum.all?(@public, &(cb[&1] === binding[&1])), do: refuse("capability_binding_mismatch")
    unless is_nil(binding["profile"]) or snapshot["profile_id"] === binding["profile"], do: refuse("capability_profile_mismatch")
    readable_status = if is_nil(readable_hashes) do
      "not_verified"
    else
      unless keys?(readable_hashes, names) and keys?(readable, names), do: refuse("incomplete_readable_file_records")
      Enum.each(names, fn name ->
        unless hex?(readable_hashes[name]) and digest(readable[name]) == readable_hashes[name], do: refuse("readable_file_digest_mismatch")
      end)
      "exact_file_hashes_verified"
    end
    reasons = ["offline_integrity_is_not_release_or_entitlement", "profile_revision_not_in_bundle"] ++
      (if binding["active"], do: [], else: ["inactive_binding"]) ++
      (if is_nil(binding["profile"]), do: ["generic_template_not_profile"], else: [])
    %{"canonical_integrity" => "verified", "readable_integrity" => readable_status,
      "generation" => binding["generation"], "profile_id" => snapshot["profile_id"],
      "supplied_revision" => snapshot["revision"], "revision_independently_verified" => false,
      "new_work_allowed" => false, "reasons" => reasons}
  end
end

Inputs and limits

Supply the original openapi.json.bytes, dictionary.json.bytes, errors.json.bytes and binding.json.bytes from the selected accepted public release. Keep those bytes unchanged; parsing and reserialising can alter their representation. Supply the complete decoded binding separately, and a local snapshot with exactly profile_id, revision and contract_binding. Real snapshot values must come from the qualified capability path.

Existing function interfaces
LanguageFunction and byte values
Pythonverify_bundle(binding, canonical, snapshot, readable=None, readable_hashes=None); byte values are bytes.
TypeScriptverifyBundle(binding, canonical, snapshot, readable?, readableHashes?); byte values are Uint8Array or Node Buffer.
ElixirEntityReleaseBundle.verify_bundle(binding, canonical, snapshot, readable, readable_hashes); byte values are binaries and the final two arguments default to nil.

The examples support the known ARCH-COMPLETE-01 generation and its flat string/boolean/null binding shape. They use the declared compact sorted-key UTF-8 encoding, without a trailing newline, omitting only binding_sha256 for its noncircular digest. This is not a general JSON canonicaliser or a validator for an arbitrary future release.

Optional readable-file checks require the exact four public filename-to-file-hash entries from an independently trusted release manifest. Without those entries, readable integrity remains unverified. Do not provide a private compiler manifest.

Missing, malformed, corrupted or mismatched inputs must stop new work. Keep any uncertain operation on its original key, creation time and recovery contract. A hash failure does not prove that an earlier request had no effect.

The retained template’s profile-header wording discrepancy is still documented in compatibility guidance. These downloads do not adopt a replacement contract or repair that artifact.

Start with a response-reading exercise

For an example with supplied synthetic outcomes, use the existing TypeScript, Python and Elixir response readers. They explain results and receipts without an account. Bundle integrity, response reading and authenticated first use are separate checks.

Next: integrate the supported release or recover without duplicating work.