or run

npx @tessl/cli init
Log in

Version

Files

docs

index-management.mdindex.mdlisting.mdreading.mdremoval.mdutilities.mdverification.mdwriting.md
tile.json

task.mdevals/scenario-3/

Cache Integrity Presence Reporter

A utility that reports whether cached content exists for given Subresource Integrity digests without reading stored data.

Capabilities

Checks multiple integrities

  • Given a cache path containing two stored digests and one absent digest, returns results in input order with booleans plus sizes for found entries and nulls for missing ones. @test

Returns canonical integrity metadata

  • When an input digest uses a different algorithm or encoding variant for content that exists, returns the canonical integrity string stored alongside the input digest and size. @test

Summarizes presence without reads

  • Produces an aggregate summary with total, found, missing counts and total size of found items using integrity presence checks only, even if one digest points to a large blob that must not be read. @test

Implementation

@generates

API

export interface PresenceResult {
  /** Integrity string provided by the caller. */
  integrity: string;
  /** Whether cached content exists for the integrity. */
  found: boolean;
  /** Size in bytes when present; null when missing. */
  size: number | null;
  /** Canonical integrity string from the cache when present; otherwise null. */
  actualIntegrity: string | null;
}

/**
 * Reports presence and metadata for each integrity without reading cached payloads.
 */
export async function checkContentPresence(
  cachePath: string,
  integrities: string[]
): Promise<PresenceResult[]>;

/**
 * Summarizes presence checks without touching stored data.
 * Returns { total, found, missing, foundSize } where foundSize sums byte sizes of present entries.
 */
export async function summarizePresence(
  cachePath: string,
  integrities: string[]
): Promise<{
  total: number;
  found: number;
  missing: number;
  foundSize: number;
}>;

Dependencies { .dependencies }

cacache { .dependency }

Provides integrity-level cache presence checks and integrity metadata without reading content bytes.