# Audit sourcemap coverage for minified errors

> Find which production errors cannot be unmangled because sourcemaps are missing, stale, or uploaded under the wrong release.

## Agent adaptation contract

- Canonical human page: https://agentry.sh/workflows/sourcemap-coverage-audit
- Execution mode: on_demand
- Immutable automation template: none
- Applies to: b2c-saas, b2b-saas, ecommerce, marketplace, content-media, devtools-api
- Required example events: $exception
- Required Agentry resources: none declared
- Do not use when:
  - Do not use until the example events are mapped to observed project signals, the current onboarding state is verified, and live event/property reads prove the required data is present.
- Ask before using:
  - Which observed events map to $exception? Is the current onboarding state verified, and do live event/property reads show non-synthetic traffic for them?
  - Which live properties provide $exception.release, $exception.source_url, $exception.minified, and which stable user or account identifier joins the signals?

This is an adaptable workflow example, not an API recipe. Map event and property names to the project's saved signal map, require status: "verified" from GET /v1/projects/:project_id/onboarding, and confirm the required signals through live event/property metadata and rows. Fetch current OpenAPI or query-blueprint details before making calls. Do not infer unattended authority from this page.

## Why this matters

Minified stacks turn an easy frontend bug into archaeology. The fastest fix is often not code; it is uploading the missing `.map` for the right release and source URL.

## What you get

- Open client-side cases with minified frames
- Which sourcemaps are already uploaded
- Missing release/source URL pairs
- A suggested upload command or CI step

## Walk through it

**You:**
> Which production errors still need sourcemaps?

**Agent:**
> I'll list client-side cases, try local unmangling, then compare against uploaded sourcemaps.

```text
Endpoint: GET /v1/projects/:project_id/cases
Exact shape: /v1/openapi.json?path=%2Fv1%2Fprojects%2F%7Bproject_id%7D%2Fcases&method=get
Use query parameters, not a JSON body.
Query/filter concept:
  status: "open"
```

```text
Endpoint: GET /v1/sourcemaps/:project_id/
Exact shape: /v1/openapi.json?path=%2Fv1%2Fsourcemaps%2F%7Bproject_id%7D%2F&method=get
Use query parameters, not a JSON body.
```

## The output

The agent returns a punch list of missing maps. For each top case, it should include release, source URL, and whether local translation succeeded.

## Setting it up

Upload sourcemaps after every frontend build. Keep release identifiers consistent between error events and uploaded artifacts.

## Variations

- *"Only audit the latest release."*
- *"Generate the CI upload step for Vite."*
- *"Which cases became readable after the last sourcemap upload?"*
